This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* RIFFWAVE.js v0.03 - Audio encoder for HTML5 <audio> elements. | |
* Copyleft 2011 by Pedro Ladaria <pedro.ladaria at Gmail dot com> | |
* | |
* Public Domain | |
* | |
* Changelog: | |
* | |
* 0.01 - First release | |
* 0.02 - New faster base64 encoding |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "project-name", | |
"description": "Template for static sites", | |
"version": "1.0.0", | |
"homepage": "http://www.project-name.com", | |
"author": { | |
"name": "Adam Reis", | |
"url": "http://adam.reis.nz" | |
}, | |
"license": "UNLICENSED", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const scrypt = require('scrypt-async'); | |
const nacl = require('tweetnacl'); | |
nacl.util = require('tweetnacl-util'); | |
// utility functions | |
// ----------------- | |
function printStage(stage) { | |
console.log(stage); | |
console.log('-'.repeat(stage.length)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create a tinycorelinux fs with custom .tcz packages | |
# prerequisites: apt-get install squashfs-tools, npm i nugget -g | |
# dl release + packages (add your packages here) | |
nugget http://tinycorelinux.net/6.x/x86_64/release/CorePure64-6.3.iso http://tinycorelinux.net/6.x/x86_64/tcz/{pkg-config,make,gcc,gcc_base-dev,gcc_libs-dev,gcc_libs,glibc_base-dev,linux-3.16.2_api_headers,fuse}.tcz -c | |
# to support compiling addons | |
unsquashfs -f pkg-config.tcz | |
unsquashfs -f make.tcz | |
unsquashfs -f gcc.tcz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* include this file AFTER your standard includes */ | |
/* clang -Weverything -Wno-unused-macros */ | |
/* SIGNED ARITHMETIC IS THE ENEMY. (use "signed" for main, etc.) */ | |
#define int BANNED | |
/* THESE OTHER THINGS ARE ALSO THE ENEMY. */ | |
#ifdef strcpy | |
#undef strcpy | |
#endif | |
#define strcpy BANNED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -f out | |
mkfifo out | |
trap "rm -f out" EXIT | |
while true | |
do | |
cat out | nc -w1 -l 1500 > >( # parse the netcat output, to build the answer redirected to the pipe "out". | |
export REQUEST= | |
while read line | |
do | |
line=$(echo "$line" | tr -d '[\r\n]') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* chacha20 - 256 bits */ | |
// Written in 2014 by Devi Mandiri. Public domain. | |
// | |
// Implementation derived from chacha-ref.c version 20080118 | |
// See for details: http://cr.yp.to/chacha/chacha-20080128.pdf | |
var Chacha20KeySize = 32; | |
var Chacha20NonceSize = 8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "pebble_os.h" | |
#include "pebble_app.h" | |
#include "pebble_fonts.h" | |
PBL_APP_INFO(MY_UUID, "Holiday", "Tom Medley", 1, 1 /* App version */, RESOURCE_ID_IMAGE_MENU_ICON, APP_INFO_WATCH_FACE); | |
Window window; | |
TextLayer text_time_layer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lsauer.com, 2013 | |
#Note: -)for convenience the function uses the re-module, but can be rewritten to fit into a lambda expression | |
# -)choose any other, more-expressive return type such as NumPy's `nan` over None if you like | |
#demonstrative-version: | |
def parseInt(sin): | |
import re | |
return int(''.join([c for c in re.split(r'[,.]',str(sin))[0] if c.isdigit()])) if re.match(r'\d+', str(sin), re.M) and not callable(sin) else None | |
#via a simple regex: |