An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
/** | |
* Replace $.ajax on your subdomain with a copy taken | |
* from your base domain. All jQuery AJAX actions go | |
* through $.ajax (i.e. $.get, $.post), so it's all good. | |
*/ | |
(function() { | |
var iframe, | |
onload, | |
queue = [], |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
/*global module:false*/ | |
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
min: { | |
ariaAccessibility: { | |
src: ['src/javascripts/jquery.selectBoxIt.ariaAccessibility.js'], | |
dest: 'src/javascripts/jquery.selectBoxIt.ariaAccessibility.min.js' | |
}, |
/* https://github.com/nikos/cmskern/blob/master/playapp/public/javascripts/widgets.js*/ | |
/** | |
* Widget for displaying a complete form as specified by the given schema. | |
*/ | |
angular.widget('my:form', function(element) { | |
this.descend(true); // compiler will process children elements | |
this.directives(true); // compiler will process directives |
var serialport = require('node-serialport') | |
var sp = new serialport.SerialPort("/dev/ttyO3", { | |
parser: serialport.parsers.raw, | |
baud: 9600 | |
}) | |
sp.on('data', function(chunk) { | |
console.log(chunk.toString('hex'), chunk.toString(), chunk) | |
}) |
<?php | |
/* | |
* Sample code for using WordPress as a REST API endpoint (vs AJAX Admin) | |
* Author: Pete Nelson @GunGeekATX | |
* | |
* 1) Create a page called API in WordPres | |
* 2) Create a file called page-api.php in your theme directory | |
* 3) Add code as-needed | |
* | |
*/ |
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |
#!/usr/bin/env bash | |
source super.bash | |
foo() { | |
echo hello | |
} | |
super_function foo | |
foo() { |
#include <Adafruit_NeoPixel.h> | |
#define PIN 1 | |
#define STRIPSIZE 16 | |
// Parameter 1 = number of pixels in strip | |
// Parameter 2 = pin number (most are valid) | |
// Parameter 3 = pixel type flags, add together as needed: | |
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) | |
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) |
Controlling your nodebot using a USB cable is great and all, and obviously you could shell out and grab a sparkcore or some other dedicated controller but what if you've got a standard arduino and you want to take an existing nodebot wireless?
Bluetooth is an option and there's this excellent JohnnyFive wiki entry that will help you there. Bluetooth can be a bit flaky though and it's range is pretty lousy. You can also look at things like XBees and what not using point to point serial, but these are expensive and very fiddly to get working.
Really, what we want is a method of transferring data over a nice, simple, standard method, requiring little configuration, low cost and we can utilise a whole stack of the code we've already produced.
Enter the WiFi232 module. These little beauties are [available from AliExpress for $12 each](http://www.aliexpress.com/item/USR-WIFI232-T-wifi-to-uart-tt