Skip to content

Instantly share code, notes, and snippets.

@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))
@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 / 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 / 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 / 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 / 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 / .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 / ansible.snippets
Last active August 29, 2015 14:09
snippet_gen generated Snipmate file for ansible
snippet rollbar_deployment
rollbar_deployment:
environment: ${1:# REQUIRED}
token: ${2:# REQUIRED}
revision: ${3:# REQUIRED}
comment: ${4}
rollbar_user: ${5}
url: ${6:https://api.rollbar.com/api/1/deploy/}
user: ${7}
validate_certs: ${8:#yes|no}
[Unit]
Description=Fix trackpad after resume
After=suspend.target
After=hibernate.target
[Service]
User=%I
Type=simple
Environment=DISPLAY=:0
ExecStart=/usr/bin/xinput -enable bcm5974
@chase
chase / fix-pkm.sh
Last active August 29, 2015 14:18
Fix Mono KPM on Linux (Add MS Certs)
# kpm restore whines about failing to write some headers, here's the non-obvious fix:
# Add Microsofts poorly signed certificates!
sudo certmgr -ssl -m https://go.microsoft.com
sudo certmgr -ssl -m https://nugetgallery.blob.core.windows.net
sudo certmgr -ssl -m https://nuget.org
mozroots --import --sync