Skip to content

Instantly share code, notes, and snippets.

View jackmakesthings's full-sized avatar
🌙

jack jackmakesthings

🌙
View GitHub Profile
@jackmakesthings
jackmakesthings / twitter-entities.js
Last active July 17, 2017 16:48 — forked from LenaicTerrier/twitter-entities.js
Vanilla (no jquery) fork; please comment or fork if you notice issues w/escaped html.
/*
* twitter-entities.js
* This function converts a tweet with "entity" metadata
* from plain text to linkified HTML.
*
* See the documentation here: http://dev.twitter.com/pages/tweet_entities
* Basically, add ?include_entities=true to your timeline call
*
* Based off existing code from Wade Simmons
* Licensed under the MIT license
@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 / mq4-hover.css
Last active August 28, 2015 01:14 — forked from aarongustafson/mq4-hover.css
Code samples from my Responsive Day Out talk Where Do We Go From Here?
@media (hover:hover) {
/* hover-related interactions are A-OK */
}
@media (hover:on-demand) {
/* hover-related interactions are potentially difficult,
maybe do something else instead */
}
@media (hover:none) {
/* No hover possible :-( */
}
@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