Skip to content

Instantly share code, notes, and snippets.

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
@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 Configuration.plist
Last active December 19, 2024 23:50
(wip) BBEdit Codeless Language Module for Nginx Configuration files
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!--
BBEdit codeless language module for nginx configs.
Requires BBEdit 8.0 or higher. To install, copy here:
~/Library/Application Support/BBEdit/Language Modules/
and relaunch BBEdit.