Skip to content

Instantly share code, notes, and snippets.

View alexindigo's full-sized avatar
💭
I may be slow to respond.

Alex Indigo alexindigo

💭
I may be slow to respond.
  • Palo Alto, CA
View GitHub Profile
@AnnoyingTechnology
AnnoyingTechnology / vegan-ballistic-gel-agar-agar-as-ballistic-gel.md
Last active December 19, 2023 13:24
Vegan ballistic gel (Agar-Agar as ballistic gel)

Receipe for vegan ballistic gel

This is a draft

Ballistic gel is often made out of gelatine, which is a produce scrapped from dead pigs bones.

It is possible to make ballisic gel without hurting animals by using Agar-Agar, a polymer extracted from seaweed.

Agar-Agar also has the advantage of being re-usable. By bringing it again above 90°C.

var $ = require('NodObjC');
$.import('Cocoa');
var installNSBundleHook = function() {
var cls = $.NSBundle;
if (cls) {
var bundleIdentifier = cls.getInstanceMethod('bundleIdentifier');
bundleIdentifier.setImplementation(function(val) {
@rvagg
rvagg / persona-login-sequence.js
Last active December 21, 2015 18:49
Selenese (Selenium scripting) in node: experimenting with a DSLish interface to WebDriver. Can connect to saucelabs or a local server or other Selenium installation. Looks sync but is heavily async, lots of talking via WebDriver.
const assert = require('referee').assert
, refute = require('referee').refute
, fail = require('referee').fail
// magic pixie dust to get us initialised
const $ = require('selenese_node/sequence')(module)
const loginEmail = 'testmystuff@mockmyid.com'
// some state to maintain along the way
@mwotton
mwotton / stupid axe ad
Created August 3, 2013 23:45
whee, i made their pointless C compile!
typedef struct {
int girlfriend;
} holder;
typedef struct {
holder a;
} toplevel;
typedef struct {
int this;
@rjcorwin
rjcorwin / open-pdf-with-width-of-screen.js
Last active December 20, 2015 07:19
From pdf.js/examples/helloworld/hello.js, modify it to open display the page specified at the width of browser. We do this by looking at the width of the PDF's page and the width of the window and then setting the scale of the page's viewport accordingly (see line 5).
PDFJS.getDocument(url).then(function(pdf) {
// Using promise to fetch the page
pdf.getPage(1).then(function(page) {
// Scale the PDF to the width of the window
var scale = window.innerWidth / page.view[2]
var viewport = page.getViewport(scale);
//
// Prepare canvas using PDF page dimensions
//
{-# LANGUAGE OverloadedStrings #-}
import qualified Network.HTTP.Conduit as H
import Control.Exception
import Web.Scotty
import System.Environment
import System.IO
import System.Directory
import Control.Monad
import Control.Monad.IO.Class
import qualified Data.ByteString.Lazy.Char8 as BS
@max-mapper
max-mapper / helloworld.js
Created November 27, 2012 06:55
droneduino
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)
})
@TooTallNate
TooTallNate / Makefile
Created September 6, 2012 21:18
Using "node" to power a Makefile (I'm not sure what this would be useful for, haha!). Requires GNU Make 3.82 or newer.
SHELL = node
.SHELLFLAGS = -e
test:
@console.log('hello');
@console.log('world');

These instructions work for the Raspberry Pi running Raspbian (hard float) and create a hardware optimized version of NodeJS for the Raspberry PI, (and include a working install and NPM!!!):

  1. Install Raspbian - http://www.raspberrypi.org/downloads

  2. Install the necessary dependecies:

sudo apt-get install git-core build-essential

(If you just installed git then you need to administer your git identity first, else adding the patches below will fail!!!)