Skip to content

Instantly share code, notes, and snippets.

View atleastimtrying's full-sized avatar

Anders Fisher atleastimtrying

View GitHub Profile

Keybase proof

I hereby claim:

  • I am atleastimtrying on github.
  • I am atleastimtrying (https://keybase.io/atleastimtrying) on keybase.
  • I have a public key whose fingerprint is 35AB 1036 07F3 550C 102E 35CE 553B 26D0 487C BA4B

To claim this, I am signing this object:

@atleastimtrying
atleastimtrying / ajax.js
Created May 24, 2016 15:58
Dependency injection for an another library in requires
module.exports = function(library){
var get = function(url, callback){
library.some_get_fn(url, 'additional param', callback);
};
return {
get: get
};
};
@atleastimtrying
atleastimtrying / events_scheduler.js
Created January 15, 2016 08:34
A tiny snippet to orchestrate cumulative timeouts in a more intuitive schedule pattern.
(function(){
var run_events = function(schedule, complete){
var running_total_duration = 0;
schedule.forEach(function(thing, index){
setTimeout(function(){
thing.event();
if(index === schedule.length - 1){
complete(running_total_duration, schedule);
}
}, running_total_duration);
@atleastimtrying
atleastimtrying / paragraph_shotgun_2_explanation.js
Last active November 21, 2015 22:35
An explanation of how paragraph shotgun 2 works!
function(){ //a nice closure to keep our variables nice and tidied away.
for(//a weird looking forloop that does some extra assignment.
var e=document.querySelectorAll("p,li,td,th,h1,span,img,h2,h3,h4,h5"),//grab all of the required elements from the page
i=0,//a count to keep track
l=e.length;//store the length so we don't have to measure again
i<l;// test if we're at the end
++i// increment our counter;
){
e[i].style.cursor="crosshair",//set the style of the current element to crosshair
e[i].addEventListener("click",function(){// listen out for a click on the current element
["ultimate_onion_hero_88","supreme_banana_hero_10","amazing_sheep_legend_55","mega_monkey_being_38","mega_sheep_person_43","ultimate_monkey_being_82","supreme_onion_being_64","ultimate_onion_legend_46","super_monkey_hero_15","super_monkey_person_38","ultimate_pig_mammal_97","amazing_banana_person_40","power_salad_hero_87","supreme_pig_mammal_1","ultimate_pig_legend_7","ultra_pig_mammal_66","super_cow_legend_48","supreme_salad_legend_52","mega_monkey_hero_31","amazing_sheep_mammal_9","power_sheep_mammal_45","amazing_cow_mammal_3","power_banana_hero_96","power_sheep_hero_87","ultra_sheep_being_2","supreme_banana_being_70","amazing_monkey_legend_56","super_salad_legend_31","power_banana_legend_83","mega_cow_hero_81","super_salad_legend_13","mega_banana_mammal_53","supreme_onion_person_20","super_cow_being_82","ultimate_onion_person_19","power_onion_legend_34","mega_banana_being_92","supreme_banana_legend_21","amazing_pig_being_40","ultra_sheep_person_82","supreme_onion_person_31","amazing_monkey_hero_83","mega_m
["ultimate_cow_person_90","supreme_onion_person_41","power_banana_person_34","super_onion_person_67","power_cow_person_17","ultra_sheep_person_59","power_onion_legend_30","mega_salad_hero_91","amazing_monkey_hero_49","ultra_sheep_legend_60","ultimate_banana_being_34","supreme_monkey_being_52","power_salad_mammal_18","mega_salad_legend_17","amazing_salad_hero_12","amazing_salad_hero_23","ultimate_monkey_hero_13","ultimate_pig_hero_4","ultimate_banana_being_31","mega_onion_mammal_65","super_monkey_person_49","supreme_salad_person_73","amazing_monkey_hero_7","super_onion_legend_67","ultimate_onion_person_24","power_pig_legend_39","amazing_pig_person_51","mega_salad_hero_39","ultra_monkey_hero_99","ultra_monkey_being_99","ultra_sheep_person_46","supreme_pig_being_7","power_monkey_mammal_0","ultimate_sheep_person_37","amazing_pig_being_29","super_sheep_hero_75","supreme_pig_hero_56","power_onion_hero_88","supreme_sheep_person_24","super_banana_mammal_10","amazing_banana_hero_10","amazing_sheep_mammal_28","power_pi
@atleastimtrying
atleastimtrying / track syncing idea.txt
Created April 15, 2015 14:02
A stupid ascii representation of the ascii art
0 = start of track, | = end of track, .=unplayed bit of track, := played bit of track
use websockets/ajax to communicate track choice and start time.
server (not delayed)
0::::::::::|
machine 1 (delayed by 1)
0.:::::::::|
@atleastimtrying
atleastimtrying / gist:c6e78281d256f92b945d
Created March 19, 2015 11:05
assets_from_diana.txt
This is a list of assets needed from Diana (designer).
Fonts used, either ttf or use fontsquirrel for getting the whole set.
Images (SVG/transparent png)
horizontally repeating (pattern)
hole punches edge top purple
hole punches edge bottom purple
hole punches edge top yellow
hole punches edge bottom yellow
@atleastimtrying
atleastimtrying / sample.json
Created March 10, 2015 17:08
Sample JSON to be loaded into the dvmtn loader
{
"values":["This", "is", "from", "another", "domain"]
}
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';'
},
dist: {