Skip to content

Instantly share code, notes, and snippets.

View jackmakesthings's full-sized avatar
🌙

jack jackmakesthings

🌙
View GitHub Profile
@jackmakesthings
jackmakesthings / copy_dictionary_recursively.gd
Created September 24, 2015 20:59
Godot currently has a bug that prevents altering dictionaries made via json_parse; this is one user's workaround. Might come in handy considering I'm using json as my godot project's data format.
# Workaround proposed by Hammer Bro again :
const DICTIONARY_TYPE = typeof({})
# Recreate the structure of a dictionary, maintaining references to all leaf-level values.
func copy_dictionary(dictionary):
var output = {}
for key in dictionary.keys():
var value = dictionary[key]
if typeof(value) == DICTIONARY_TYPE:
@jackmakesthings
jackmakesthings / social_sort.js
Created July 29, 2015 01:09
Experiment on sorting social data
var data = {
"posts": [{
"title": "Charlie Wilson",
"body": "As the lead singer of The Gap Band, Charlie Wilson had chart-topping hits — and a drug addiction that left him homeless. But determination got him clean and back into the business.",
"upvotes": 2,
"downvotes": 0,
"flags": 0,
"relationship": "friend",
"comments": 4,
"author_repuation": 81
@jackmakesthings
jackmakesthings / Slideshow.es6.js
Created July 22, 2015 17:58
slideshow pseudo-code, to make sure i'm thinking about this correctly
class Slideshow {
constructor($, Utils) {
let utils = new Utils(),
orientationChange = utils.testFeature('onorientationchange'),
isActive = false,
isChanging = false,
alwaysShowControls = false, // this would be updated via however we're checking for devices - true on touch devices
totalSlides = 0,
currentSlide = 0;
@jackmakesthings
jackmakesthings / SassMeister-input-HTML.jade
Created July 21, 2015 15:33
Generated by SassMeister.com.
.row
.item
.item
.item
@jackmakesthings
jackmakesthings / SassMeister-input-HTML.jade
Last active August 29, 2015 14:25
Generated by SassMeister.com.
.page
.wrapper
.main
.module.four
.section-header Main/Four
.item
.item
.item
.item
.module.three
@jackmakesthings
jackmakesthings / SassMeister-input-HTML.jade
Last active August 29, 2015 14:25
Generated by SassMeister.com.
mixin item
.item
img(src="http://placehold.it/400x150/eee/?text=img")
h3.headline An item headline
p.description A sentence or two of descriptive copy
mixin item2
.item
img(src="http://placehold.it/400x150/eee/?text=img")
h3.headline A headline that is longer than the other
@jackmakesthings
jackmakesthings / SassMeister-input-HTML.html
Created July 14, 2015 00:29
Generated by SassMeister.com.
<div class="wrapper">
<div class="main">
<div class="item-row halves">
<div class="item"><img src="http://placehold.it/400x150/eee/?text=img"/>
<h3 class="headline">A headline that is longer than the other</h3>
<p class="description">What happens if the box is taller than others around it? Everything should clear appropriately.</p>
</div>
<div class="item"><img src="http://placehold.it/400x150/eee/?text=img"/>
<h3 class="headline">An item headline</h3>
@jackmakesthings
jackmakesthings / SassMeister-input-HTML.jade
Last active August 29, 2015 14:24
Generated by SassMeister.com.
mixin item
.item
img(src="http://placehold.it/400x150/eee/?text=img")
h3.headline An item headline
p.description A sentence or two of descriptive copy
mixin item2
.item
img(src="http://placehold.it/400x150/eee/?text=img")
h3.headline A headline that is longer than the other
@jackmakesthings
jackmakesthings / SassMeister-input-HTML.html
Created July 13, 2015 21:07
Generated by SassMeister.com.
<div class="wrap -three">
<div class="block -demo">Hello world!</div>
<div class="block -demo">Hello world!</div>
<div class="block -demo">Hello world!</div>
<div class="block -demo">Hello world!</div>
<div class="block -demo">Hello world!</div>
</div>
<div class="wrap -four">
<div class="block -demo">Hello world!</div>
<div class="block -demo">Hello world!</div>
@charset "UTF-8";
/* line 4, neat/grid/_box-sizing.scss */
html {
box-sizing: border-box; }
/* line 11, neat/grid/_box-sizing.scss */
*,
*::after,
*::before {
box-sizing: inherit; }