Skip to content

Instantly share code, notes, and snippets.

@chase
chase / .ctags
Last active December 4, 2020 11:52 — forked from jesstelford/.ctags
--langdef=moonscript
--langmap=moonscript:.moon
--regex-moonscript=/(^|=[ \t])*class ([A-Za-z_][A-Za-z0-9_]+\.)*([A-Za-z_][A-Za-z0-9_]+)( extends ([A-Za-z][A-Za-z0-9_.]*)+)?$/\3/c,class/
--regex-moonscript=/^[ \t]*@?(([A-Za-z][A-Za-z0-9_.]*)+):.*[-=]>.*$/\1/m,method/
--regex-moonscript=/^[ \t]*(([A-Za-z][A-Za-z0-9_.]*)+)[ \t]*=.*[-=]>.*$/\1/f,function/
--regex-moonscript=/^[ \t]*(([A-Za-z][A-Za-z0-9_.]*)+)[ \t]*=[^->\n]*$/\1/v,variable/
--regex-moonscript=/^[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+)[ \t]*=[^->\n]*$/\1/p,property/
--regex-moonscript=/^[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+):[^->\n]*$/\1/s,static property/
--regex-moonscript=/^[ \t]*(([A-Za-z][A-Za-z0-9_.]*)+):[^->\n]*$/\1/p,property/
--regex-moonscript=/(new:[ \t]*\()@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?/\3/p,property/
@chase
chase / uuidv5-email.js
Created July 28, 2014 22:22
UUID v5 calculator for email addresses
var crypto = require('crypto');
var nsURL = new Buffer([0x6b,0xa7,0xb8,0x11,0x9d,0xad,0x11,0xd1,0x80,0xb4,0x00,0xc0,0x4f,0xd4,0x30,0xc8]);
var emailUUID = function(email) {
var shasum = crypto.createHash('sha1');
shasum.update(Buffer.concat([nsURL, new Buffer('mailto:'+email)]));
shasum=shasum.digest();
var result = new Buffer(16);
shasum.copy(result, 0, 0, 16);
@chase
chase / gist:5a212f414b44efc1f560
Created July 15, 2014 05:19
LINE Sticker Window Rule for Awesome WM
{ rule = { instance = "Line.exe", name = "emoji" },
properties = { floating = true, raise = true, focus = true },
callback = function (c)
local g = c:geometry()
mouse.coords({x=g.x + (g.width/2), y=g.y + (g.height/2)})
return awful.client.setslave(c)
end
}
@chase
chase / connectbot-gruvbox-dark.sql
Last active August 29, 2015 14:00
Gruvbox Colors for ConnectBot
-- Gruvbox Colors for ConnectBot
-- Chase Colman
--
-- Based on the Connectbot Solarized Colors by Priyesh Patel
-- https://github.com/priyeshpatel/connectbot-colors-solarized
-- *******************************************************************
-- The following commands should be executed on this SQLite DB:
-- /data/data/org.connectbot/databases/hosts
@chase
chase / fobot_stats.py
Last active January 4, 2016 02:19
A Willie IRC Bot (http://willie.dftba.net/) module that scrapes character info off of Fallout IRC RPG (http://falloutirc.webs.com/)Requires: Python 2.7, Willie, fuzzywuzzy, and lxml
"""
fobot_stats.py - New Reno Fallout Stat Module
Copryight 2014 Chase Colman, https://gist.github.com/chase/8554277
Licensed under the MIT License
"""
# TODO: Reorganize into Classes
import re
@chase
chase / global_ycm_config.py
Created August 29, 2013 20:57
Hacky, ugly, quickly-written YCM global file that checks for an Xcode project and pulls the flags from a dry run. Works just fine, but has no fallbacks.
from os import listdir
from os.path import dirname, join
import subprocess
import vim
import ycm_core
from ycm.completers.cpp.flags import _RemoveUnusedFlags
cached_xcode_flags = {}
def MakeRelativePathsInFlagsAbsolute(flags, working_directory):
@chase
chase / highlight.js
Created October 22, 2012 18:23
Times for highlightAuto Test
function highlightAuto(text) {
var result = {
keyword_count: 0,
relevance: 0,
value: escape(text)
};
var second_best = result;
for (var key in languages) {
console.time(key); // Start timer
if (!languages.hasOwnProperty(key))