Skip to content

Instantly share code, notes, and snippets.

@isao
isao / set-my-ip.sh
Last active August 29, 2015 14:14
update subdomain IP address on cloudflare
#!/bin/sh -eu
# config
#
email=REDACTED
token=$(security find-generic-password -ws 'Cloudflare API key' -a $email)
domain=REDACTED
subdomain=REDACTED
@isao
isao / msbuild-here.sh
Last active January 24, 2019 14:48
From a Mac, tell VMWare to run MSBuild in the Mac's current working directory. Any arguments will be passed through to MSBuild. Usage: `cd path/to/web.sln && msbuild-here.sh [args]`
#!/bin/sh -eu
#
# This script runs MSBuild in a VMWare image from a Mac. It translates the Mac's
# current working directory to the corresponding Windows VM path to a shared
# directory. Any arguments to this script will be passed through to MSBuild.
#
# Usage: cd path/to/web.sln && msbuild-here.sh [args]
#
# https://gist.github.com/isao/d871a5b90e3505cc4151
class TypeScriptLexer(RegexLexer):
"""
For `TypeScript <http://typescriptlang.org/>`_ source code.
.. versionadded:: 1.6
"""
name = 'TypeScript'
aliases = ['ts']
filenames = ['*.ts']
@isao
isao / nginx.conf
Last active August 29, 2015 14:04
run nginx
events {}
http {
server {
listen 80;
server_name reachclient.dev.mr.tv3cloud.com;
root MRGIT/ReachClient/Web/builds/private;
index Landing.html;
# for source map access
@isao
isao / adapter.js
Last active February 24, 2020 05:25
est3k hackday files with code liberally borrowed from various places too hastily to credit :/
var RTCPeerConnection = null;
var getUserMedia = null;
var attachMediaStream = null;
var reattachMediaStream = null;
var webrtcDetectedBrowser = null;
var webrtcDetectedVersion = null;
function trace(text) {
// This function is used for logging.
if (text[text.length - 1] == '\n') {
@isao
isao / cors-OPEN.conf
Last active August 29, 2015 14:03
nginx quick and dirty configs
# dev env ONLY
add_header 'Access-Control-Allow-Origin' *;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' *;
@isao
isao / TypeScript.plist
Last active November 30, 2023 11:59 — forked from davethesoftwaredev/TypeScript.plist
BBEdit Codeless Language Module for TypeScript syntax coloring and class/interface/function folding.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- https://gist.github.com/isao/5f6fbe89a438086c36d8
BBEdit Language Module for TypeScript
Put this file in
~/Library/Application Support/BBEdit/Language Modules
or equivalent.
Forked from
@isao
isao / partial.js
Last active August 29, 2015 13:58
partial application of parameters, allowing (based on <http://ejohn.org/blog/partial-functions-in-javascript/>)
// fn - function to call
// signature - array of arguments to use to call fn, if an array value is `undefined`
// then use the curried/partial function parameter
function partial(fn, signature) {
var slice = Array.prototype.slice;
return function apply() {
var args = slice.call(arguments);
return fn.apply(fn, signature.map(function fillIn(arg) {
return arg === undefined ? args.shift() : arg;
@isao
isao / callSliced.js
Last active August 29, 2015 13:58
call a function with a subset (slice) of the arguments passed to it.
function callSliced(fn, a, b) {
var args = [a]; // 1st argument to slice
if (b) args.push(b); // 2nd argument to slice, if any
return function apply() {
return fn.apply(fn, Array.prototype.slice.apply(arguments, args));
};
}
@isao
isao / nginx.conf
Created February 14, 2014 23:05 — forked from srpouyet/nginx.conf
### Nginx upstart script
### source: http://serverfault.com/a/391737/70451
### /etc/init/nginx.conf
description "nginx http daemon"
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]
env DAEMON=/usr/local/sbin/nginx