(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/bin/sh -u | |
| fileLocal="${1:-example-local-file.ext}" | |
| bucket="${2:-example-bucket}" | |
| remotePath="${3:-remote-path}" | |
| region="${4:-}" | |
| awsAccess="${5:-YOUR_AWS_ACCESS_KEY}" | |
| awsSecret="${6:-YOUR_AWS_SECRET_KEY}" | |
| m_openssl() { |
| #!/bin/sh -u | |
| # To the extent possible under law, Viktor Szakats (vszakats.net) | |
| # has waived all copyright and related or neighboring rights to this | |
| # script. | |
| # CC0 - https://creativecommons.org/publicdomain/zero/1.0/ | |
| # Upload a file to Amazon AWS S3 using Signature Version 4 | |
| # | |
| # docs: |
| if (!require(neuralnet)) {install.packages("neuralnet")} | |
| library(neuralnet) | |
| #nn for learning how to calculate a square root | |
| set.seed(1) | |
| train.x <- sample(1:100, 50, replace = T) | |
| head(train.x) |
| # Compiled source # | |
| ################### | |
| *.com | |
| *.class | |
| *.dll | |
| *.exe | |
| *.o | |
| *.so | |
| # Packages # |
| /** | |
| * http://www.codesuck.com/2012/02/transpose-javascript-array-in-one-line.html | |
| */ | |
| function transpose(a) { | |
| return Object.keys(a[0]).map(function (c) { | |
| return a.map(function (r) { | |
| return r[c]; | |
| }); | |
| }); | |
| } |
| /* | |
| Execute this from the javascript console in the browser, after you log in pentaho. | |
| Get the listing of children of :home | |
| Go through the list and send a put to deletepermanent with the id of the node. | |
| */ | |
| $.getJSON("http://<server_url>:8080/pentaho/api/repo/files/:home/children", function(data){ | |
| $.each(data, function(i, nodes){ | |
| nodes.forEach(function(node){ | |
| console.log(node.path,node.id); |
| /*jshint esnext: true */ | |
| /* | |
| https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes | |
| 1. Create a list of consecutive integers from 2 through n: (2, 3, 4, ..., n). | |
| 2. Initially, let p equal 2, the smallest prime number. | |
| 3. Enumerate the multiples of p by counting to n from 2p in increments of p, and mark them in the list (these will be 2p, 3p, 4p, ...; the p itself should not be marked). |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>D3 clock Example</title> | |
| <style> | |
| </style> | |
| </head> | |
| <body> | |
| <div id="chart1"></div> |
| #!/usr/bin/ruby | |
| # Create display override file to force Mac OS X to use RGB mode for Display | |
| # see http://embdev.net/topic/284710 | |
| require 'base64' | |
| data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
| edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
| vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten |