Skip to content

Instantly share code, notes, and snippets.

@ivarvong
ivarvong / gist:2131568
Created March 20, 2012 05:10
using node.js to grab images from a webcam for a timelapse
// /srv/www/ivarvong.com/public_html/allenhall/timelapse
var util = require('util')
, exec = require('child_process').exec
, child;
function pad(num) {
if (num < 10) {
return "0" + num;
} else {
@Fabryz
Fabryz / package.json
Created April 25, 2012 21:35
Save all images contained in a website domain/paths
{
"name": "rakeup",
"version": "0.0.1",
"author": "Fabrizio Codello",
"engines": {
"node": "0.6.x"
},
"private": true,
"dependencies": {
"http-agent": "0.1.x",
var msg = JSON.stringify( state );
var getUTF8Size = function( str ) {
var sizeInBytes = str.split('')
.map(function( ch ) {
return ch.charCodeAt(0);
}).map(function( uchar ) {
// The reason for this is explained later in
// the section “An Aside on Text Encodings”
return uchar < 128 ? 1 : 2;
// Reads accel data and logs to serial. then flashes lights. When x is level, it goes faster.
#include <Wire.h>
#define BMA250_I2CADDR 0x18
#define BMA250_RANGE 0x03 // 0x03 = 2g, 0x05 = 4g, 0x08 = 8g, 0x0C = 16g
#define BMA250_BW 0x08 // 7.81Hz (update time of 64ms)
int AccelX;
int AccelY;
@ifthenelse
ifthenelse / gist:7925614
Created December 12, 2013 09:53
Impostazioni di esportazione dei dump mySQL di phpMyadmin
Tabella
@SERVER@-@DATABASE@-@TABLE@-%Y%m%d-%H%M%S
Database
@SERVER@-@DATABASE@-%Y%m%d-%H%M%S
Server
@SERVER@-%Y%m%d-%H%M%S
@fcalderan
fcalderan / perftest.sh
Last active March 8, 2017 14:37
A small bash utility for testing slower connection. Use chmod +x perftest.sh to make the script executable. Thanks to Matteo Rosati for sharing basic commands
#!/bin/sh
CMD="$1"
RATE="$2"
DELAY="$3"
if [ "$RATE" = "" ] ; then
RATE=500
fi
if [ "$DELAY" = "" ] ; then
@creationix
creationix / GamePad-TinyDuino.md
Last active January 12, 2019 01:29
A sample program showing how to control a tiny arduino using a gamepad, linux, node.js, and firmata. https://www.youtube.com/watch?v=XjCsDosGghA

Instructions

  • npm install johnny-five
  • Plug in Logitech Gamepad to linux laptop
  • plug in tinyduino with lightring shield.
  • run sudo node move.js
  • move the gamepad to see lights move.
@crittermike
crittermike / ExampleModuleController.php
Last active June 17, 2021 12:55
Example of overriding a route controller in Drupal 8
<?php
/**
* @file
* Contains \Drupal\example_module\Controller\ExampleModuleController.
*/
// THIS FILE BELONGS AT /example_module/src/Controller/ExampleModuleController.php
namespace Drupal\example_module\Controller;
@PWA-GouldA
PWA-GouldA / gameengines.md
Created April 13, 2012 05:39 — forked from bebraw/gameengines.md
List of JS game engines. You can find a wikified version at https://github.com/bebraw/jswiki/wiki/Game-Engines. Feel free to modify that. I sync it here every once in a while.

IMPORTANT! Remember to check out the wiki page at https://github.com/bebraw/jswiki/wiki/Game-Engines for the most up to date version. There's also a "notes" column in the table but it simply does not fit there... Check out the raw version to see it.

This table contains primarily HTML5 based game engines and frameworks. You might also want to check out these pages: [[Feature Matrix|Game-Engine-Feature-Matrix]], [[Game Resources]].

Name Latest Release Size (KB) License Type Unit Tests Docs Repository Notes
ActionJS no github AS3 like in Javascript
Akihabara 1.3.1 (2011/05) 453 GPL2, MIT Classic Repro no API github Inten
@sindresorhus
sindresorhus / LICENSE.txt
Created June 4, 2012 12:14 — forked from 140bytes/LICENSE.txt
Photo Booth (140byt.es)
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 Sindre Sorhus <http://sindresorhus.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE