Skip to content

Instantly share code, notes, and snippets.

View hertzg's full-sized avatar
🏠
Working from home

George Hertz hertzg

🏠
Working from home
View GitHub Profile
#!/bin/sh
## Node.js for Raspberry Pi Packaging Script
## =========================================
## Execute this script from within node.js git repo
## Use like this:
## ~/node/$ VERSION=v0.10.0 ./buildnode.sh
if [ -z $VERSION ]; then
echo "set the VERSION first"
exit 1
@hertzg
hertzg / .ctags
Last active August 29, 2015 14:08 — forked from markwu/.ctags
--langdef=js
--langmap=js:.js
--regex-js=/([A-Za-z0-9_$]+)[ \t]*[:=][ \t]*function[A-Za-z0-9_$ \t]*\(/\1/f, function, functions/
--regex-js=/\[[ \t]*['"]([A-Za-z0-9_$ ]+)['"][ \t]*\][ \t]*=[ \t]*function[A-Za-z0-9_$ \t]*\(/\1/f, function, functions/
--regex-js=/['"]([A-Za-z0-9_$ ]+)['"][ \t]*:[ \t]*function[A-Za-z0-9_$ \t]*\(/\1/f, function, functions/
--regex-js=/function[ \t]+([A-Za-z0-9_$]+)[ \t]*([^)])/\1/f, function, functions/
--regex-js=/(\b[A-Z][A-Za-z0-9_$]*)[ \t]*=[ \t]*new[ \t]+/\1/v, variable, variables/
--regex-js=/(\b[A-Z][A-Z0-9_$]*)[ \t]*=/\1/c, constant, contants/
int ledPin = 13;
//led for visualization (use 13 for built-in led)
int speakerPin = 11;
//speaker connected to one of the PWM ports
#define c 261
#define d 294
#define e 329
#define f 349
@hertzg
hertzg / tls_creds.js
Last active August 29, 2015 14:14 — forked from mildmojo/tls_creds.js
var tls = require('tls');
var constants = require('constants');
// Disable client session renegotiation, no known use case per:
// https://www.ssllabs.com/downloads/SSL_TLS_Deployment_Best_Practices_1.3.pdf
// By virtue of require() caching, this will affect all code using `tls`.
tls.CLIENT_RENEG_LIMIT = 0;
// Based on whitelist proposed at: https://bugs.ruby-lang.org/issues/9424
// And SSL/TLS Best Practices: https://www.ssllabs.com/downloads/SSL_TLS_Deployment_Best_Practices_1.3.pdf
@hertzg
hertzg / fun.coffee
Last active August 29, 2015 14:15 — forked from fson/fun.coffee
# factorial
$ = (_) ->
__ = _
--__ && _ = _ * $ __
_
# each
$$ = (_, __) ->
@hertzg
hertzg / .mpdconf
Last active August 29, 2015 14:19 — forked from robcowie/.mpdconf
## ~/.mdpconf
port "6600"
music_directory "~/Music/"
playlist_directory "~/.mpd/playlists"
db_file "~/.mpd/mpd.db"
log_file "~/.mpd/mpd.log"
pid_file "~/.mpd/mpd.pid"
state_file "~/.mpd/state"
#bind_to_address "~/.mpd/mpd.sock"
@hertzg
hertzg / persistence.xml
Last active August 29, 2015 14:26 — forked from mortezaadi/persistence.xml
persistence xml configurations for major databases and jpa providers
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<!-- derby -->
@hertzg
hertzg / debug.js
Created November 9, 2017 12:52 — forked from ptomato/debug.js
GJS debugger
const GLib = imports.gi.GLib;
const Lang = imports.lang;
const System = imports.system;
let _breakpoints = 0;
function _getCurrentStack() {
try {
throw new Error();
} catch (e) {
@hertzg
hertzg / save.py
Created March 30, 2019 15:32 — forked from mickael9/save.py
Factorio map metadata parser
from zipfile import ZipFile
from struct import Struct
class Deserializer:
u16 = Struct('<H')
u32 = Struct('<I')
def __init__(self, stream):
self.stream = stream