Skip to content

Instantly share code, notes, and snippets.

View pkpp1233's full-sized avatar

Paul Katsen pkpp1233

View GitHub Profile
@pkpp1233
pkpp1233 / gist:829eab1e9c2371351ac0
Last active August 29, 2015 14:08
node lib install
# in your command line, install this helper library to your working directory or globally (with -g flag).
# make sure you have node installed on your local machine!
$ npm install blockspring
# in your command line, pull this helper library to your function's local directory or install globally to your php path.
# make sure you have php installed on your local machine!
$ curl -o ./blockspring.php https://raw.githubusercontent.com/blockspring/blockspring-php/master/blockspring.php
@pkpp1233
pkpp1233 / gist:57533cf6ec36f9de89c9
Last active August 29, 2015 14:08
r install lib.
# Run these commands from within R.
# make sure you have R >= 3.1.0 installed on your local machine!
install.packages("devtools")
library("devtools")
install_github("blockspring/blockspring.R")
# type "irb" in your command line to open an interactive ruby shell.
require "blockspring"
result = Blockspring.run("pkpp1233/110c49f4690420f82d47ffc4f82d5d13", { "url" => "http://lacuadramagazine.com/wp-content/uploads/sangeh-monkey-forest-101.jpg", "numcolors" => 3})
puts result
# type "python" in your command line to open an interactive python shell.
import blockspring
result = blockspring.run("pkpp1233/110c49f4690420f82d47ffc4f82d5d13", { "url": "http://lacuadramagazine.com/wp-content/uploads/sangeh-monkey-forest-101.jpg", "numcolors": 3})
print result
// type "node" in your command line to open an interactive node shell.
var blockspring = require("blockspring");
blockspring.run("pkpp1233/110c49f4690420f82d47ffc4f82d5d13", { "url": "http://lacuadramagazine.com/wp-content/uploads/sangeh-monkey-forest-101.jpg", "numcolors": 3}, function(result){
console.log(result);
})
<?php
# type "php -a" in your command line to open an interactive php shell.
require('blockspring.php');
$result = Blockspring::run("pkpp1233/110c49f4690420f82d47ffc4f82d5d13", array("url" => "http://lacuadramagazine.com/wp-content/uploads/sangeh-monkey-forest-101.jpg", "numcolors" => 3 ));
print_r($result);
# type "R" in your command line to open an interactive R shell.
library("blockspring")
result = blockspringRun("pkpp1233/110c49f4690420f82d47ffc4f82d5d13", list("url" = "http://lacuadramagazine.com/wp-content/uploads/sangeh-monkey-forest-101.jpg", "numcolors" = 3))
print(result)
@pkpp1233
pkpp1233 / gist:00c5b94c9fe1b38da470
Created November 5, 2014 19:56
r create with cli
# create a new R function based on the sample template.
$ blockspring new R "My new R block"
# enter into our new function's directory.
$ cd my-new-r-block
# create a new php function based on the sample template.
$ blockspring new php "My new PHP block"
# enter into our new function's directory.
$ cd my-new-php-block