Skip to content

Instantly share code, notes, and snippets.

# =============================================================
# = OpenMeta to OS X Tags =
# =============================================================
# Script to convert OpenMeta tags to OS X Mavericks tags.
#
# Created by Zettt (Andreas Zeitler) on 2013-06-28
# Source www.macosxscreencasts.com, mosx.tumblr.com
#
# OpenMeta to OS X Tags by Andreas Zeitler is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike
@isao
isao / php-lint.applescript
Created February 13, 2014 21:41
BBEdit Script to lint PHP and display a BBEdit Results Browser
property phpref : "/usr/bin/env php -l "
on phpErrLine(php_msg, bbfref)
set errIndicator to " in " & (POSIX path of bbfref) & " on line "
set off to (offset of errIndicator in php_msg) + (length of errIndicator)
get text off thru -1 of php_msg
return first paragraph of result as integer
end phpErrLine
on phpErrMsg for bbfref out of php_msg
@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
@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 / 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 / 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 / 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
class TypeScriptLexer(RegexLexer):
"""
For `TypeScript <http://typescriptlang.org/>`_ source code.
.. versionadded:: 1.6
"""
name = 'TypeScript'
aliases = ['ts']
filenames = ['*.ts']
@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
git checkout \
$(git show -s --pretty='%T' \
$(git show-ref -d \
$(git describe --abbrev=0) |\ # grab the most recent tag
tail -n1 |\
awk '{print $1}'\ # dereference the commit hash it refers to
)\ # ... show the tree-hash it points at
) -- test # check that version's "test/" directory out into cwd
make test # if this fails, you should bump major,
# otherwise bump minor or patch.