Skip to content

Instantly share code, notes, and snippets.

View loadedsith's full-sized avatar

Graham P Heath loadedsith

View GitHub Profile
@loadedsith
loadedsith / keymap.c
Created September 20, 2017 19:03
process_record_user backlight feedback
# Custom code begins on line 25.
# [...]
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
print("mode just switched to qwerty and this is a huge string\n");
set_single_persistent_default_layer(_QWERTY);
#!/usr/bin/env bash
[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"
if [ -z ${TM_PROJECT_DIRECTORY+x} ]; then
echo -n "$TM_FILEPATH" | pbcopy
echo "$TM_FILEPATH"'\n Absolute path copied to clipboard'
else
TM_PROJECT_DIRECTORY="$TM_PROJECT_DIRECTORY/"
echo -n "${TM_FILEPATH#$TM_PROJECT_DIRECTORY}" | pbcopy
@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>
@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 / 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>
#!/usr/bin/env bash
# before:
# $> tree .
# .
#
# 0 directories, 0 files````
#
#
# after:
# $> tree .
@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.
@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 / 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 / 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
);