Skip to content

Instantly share code, notes, and snippets.

View thehig's full-sized avatar

David Higgins thehig

  • Dublin, Ireland
View GitHub Profile
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Oceanic Next Color Scheme/Oceanic Next.tmTheme",
"theme": "Oceanic Next.sublime-theme",
"draw_white_space": "all",
"font_options":
[
"gray_antialias",
"subpixel_antialias"
@thehig
thehig / promiseChaining.js
Last active October 6, 2016 14:38
js: Promise Chaining
myModule.validate = function(params){
return new WinJS.Promise(function(ccb, ecb){
myModule.preValidate(params).then(
function prevalidateSuccess(result){
ccb(result);
},
function prevalidateError(err){
ecb(err);
})
});
@thehig
thehig / shortcuts.md
Last active December 21, 2016 11:09
misc: Shortcuts cheat sheet
@thehig
thehig / Readme.md
Last active September 11, 2016 14:48
processing: evolution3WEB
@thehig
thehig / l33t seg.ino
Created August 18, 2016 10:40 — forked from Skymetal/l33t seg.ino
Arduino: 1337 7segment
// CONST's
int DS_pin = 8;
int STCP_pin = 9;
int SHCP_pin = 10;
int C1_pin = 1;
int C2_pin = 2;
int C3_pin = 3;
int C4_pin = 4;
@thehig
thehig / examplepatterns.sublime-project
Created August 18, 2016 10:36
sublime: Example project patterns
{
"folders":
[
{
"file_exclude_patterns":
[
// "*.sln"
],
"folder_exclude_patterns":
[
@thehig
thehig / strobe-led.ino
Created August 4, 2016 14:36
arduino: photocell controlled led strobe
// CONST's
int DS_pin = 8;
int STCP_pin = 9;
int SHCP_pin = 10;
int NUM_LED = 8;
// 8 LED Registers
boolean registers[8];
// Direction of LED travel
boolean goingUp = true;
@thehig
thehig / deleteSlack.js
Created July 26, 2016 18:14
js: Automate slack message deletion
/*Works on Slack Archive Page*/
function delNext(delay, cb){
console.log("Starting delete");
/*Click Delete*/
document.querySelector('#batch_delete_link').click();
setTimeout(function(){
/*Click All*/
document.querySelector('#batch_delete_div > p:nth-child(3) > a:nth-child(2)').click();
setTimeout(function(){
/*Click Delete*/
[
// https://forum.sublimetext.com/t/quick-switch-project-shortcut-doesnt-work-anymore/17261/6
{ "keys": ["ctrl+alt+p"], "command": "prompt_select_workspace" }
]
@thehig
thehig / data_driven_test.spec.coffee
Created June 22, 2016 14:44
coffee: Data driven test
# This is a test snippet that will iterate over a collection of expected values, and compare them against the test values
describe "option 2", ->
it "has 5 observableValues", -> expect(product.required_fields[1].observableValues).to.have.length(5)
somoText = (text, i) -> it "[" + i + "] text '" + text + "'", -> expect(product.required_fields[1].observableValues[i]).to.have.property('text', text)
somoText(item, i) for item, i in ["Color: Snow", "Color: Sky Blue", "Color: Gray Granite", "Color: Soft Pink", "Color: Light Lemon"]