Skip to content

Instantly share code, notes, and snippets.

View loadedsith's full-sized avatar

Graham P Heath loadedsith

View GitHub Profile
@loadedsith
loadedsith / stackEgg.js
Last active August 29, 2015 14:18
StackEgg Automation Script
var clickButton = function(actionElement) {
console.log('actionElement', actionElement);
$(actionElement).click();
}
var defaultStats = {
'questions': {
'id': '#egg-stat-questions',
'action':clickButton.bind(null,'#egg-action-ask button')
},
@loadedsith
loadedsith / emoji-short.coffee
Last active November 7, 2015 00:19
Hubot Emoji Script w/ Specific emoji blocking
# Description:
# emoji.coffee - Replaces :text: or text with emojis.
# Great for IRC or anywhere not already emojified.
#
# Dependencies:
# None
#
# Configuration:
# None
#
@loadedsith
loadedsith / SassMeister-input.scss
Last active August 29, 2015 14:19
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
$ru: (
name: 'ru',
font-size: 12px,
font-family: "Helvetica",
letter-spacing: 1px
);
@loadedsith
loadedsith / gist:503575ad041f873bdcb5
Created April 23, 2015 19:24
Toggle html[lang=___] script
var DEFAULT_VALUE = 'ru-ru';
function toggle (language) {
language = (typeof language === 'undefined') ? DEFAULT_VALUE : language;
var currentLang = $('html').attr('lang');
if (currentLang === 'en') {
$('html').attr('lang', language);
}else if (currentLang === language) {
$('html').attr('lang', 'en');
} else {
@loadedsith
loadedsith / gist:a5d628856208cb5b7e3b
Last active August 29, 2015 14:20
my .bash_profile
alias c=clear
function gulp() { clear; /Users/grahamh/npm/bin/gulp "$@" ;}
#alias mate='open -a TextMate.app'
export NVM_DIR="/Users/grahamh/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
export PATH=/Users/grahamh/.npm/bin:$PATH
export PATH=/Users/grahamh/npm/bin:$PATH
@loadedsith
loadedsith / RDemo.r
Created August 20, 2015 04:50
TextMate R language grammar demo with number tick number plus for stack
#' This is a special R script which can be used to generate a report. You can
#' write normal text in roxygen comments.
#'
#' First we set up some options (you do not have to do this):
#+ setup, include=FALSE
library(knitr)
opts_chunk$set(fig.path = 'figure/silk-')
#' The report begins here.
#!/usr/bin/env bash
# before:
# $> tree .
# .
#
# 0 directories, 0 files````
#
#
# after:
# $> tree .
@loadedsith
loadedsith / Slugify.tmMacro
Created July 20, 2016 18:50
Slugify Macro for TextMate 2
<?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">
<plist version="1.0">
<dict>
<key>commands</key>
<array>
<dict>
<key>command</key>
<string>lowercaseWord:</string>
</dict>
@loadedsith
loadedsith / captions.sbv
Created July 22, 2016 01:45
Youtube Sample Captions
0:00:04.120,0:00:05.319
magnetic tweets
0:00:05.319,0:00:09.889
is a job base lot detecting
0:00:09.889,0:00:12.929
Twitter it was created
0:00:12.929,0:00:16.359
@loadedsith
loadedsith / StripTimestamp.tmMacro
Created July 22, 2016 01:48
Strip YouTube Caption Timestamps with Textmate
<?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">
<plist version="1.0">
<dict>
<key>commands</key>
<array>
<dict>
<key>command</key>
<string>selectAll:</string>
</dict>