Skip to content

Instantly share code, notes, and snippets.

View terkelg's full-sized avatar
🔵
Git'n stuff done

Terkel terkelg

🔵
Git'n stuff done
View GitHub Profile
@arielsalminen
arielsalminen / config.cson
Last active August 29, 2015 14:05
My Atom editor settings, preview: https://dl.dropboxusercontent.com/u/2206960/atom.jpg In addition you’ll need the following free fonts: "Input Mono Regular" & "Input Sans Regular" from http://input.fontbureau.com/download/
'editor':
'lineHeight': 1.45
'softWrap': true
'normalizeIndentOnPaste': true
'tabLength': 2
'preferredLineLength': 100
'invisibles':
'cr': '↩'
'eol': ''
'space': '·'
@stammy
stammy / _media-queries.scss
Created November 26, 2012 06:16 — forked from anthonyshort/_media-queries.scss
Media Queries in Sass
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
@kimroen
kimroen / high-dpi-media.scss
Created November 20, 2012 10:24 — forked from marcedwards/high-dpi-media.css
A Sass media query mixin that captures almost all high DPI aware devices.
/* ----------------------------------------------------------------------- */
/* */
/* Improved upon a mixin from 37signals and combined */
/* with these numbers from marc. */
/* */
/* 37signals-version: */
/* http://37signals.com/svn/posts/3271-easy-retina-ready-images-using-scss */
/* */
/* @kimroen */
/* */
@japaz
japaz / doctor_translate.erl
Created November 25, 2011 21:50
7L7W Erlang - Day3
% Monitor the translate_service and restart it should it die.
-module(doctor_translate).
-export([loop/0]).
loop() ->
process_flag(trap_exit, true),
receive
new ->
io:format("Creating and monitoring process.~n"),
register(translator, spawn_link(fun translate_service:loop/0)),
@stakes
stakes / frameless.coffee
Last active April 14, 2017 21:08
Framer.js module to open prototypes in Frameless
# Add the following line to your project in Framer Studio.
# `frameless = require "frameless"`
frameless = {}
# Directly opens the prototype in Frameless
frameless.open = ->
intent = "frameless://"
url = intent + window.location.host + window.location.pathname + "/"
window.location.replace url
@jasonswearingen
jasonswearingen / redux-simple-router-example.tsx
Last active October 31, 2017 19:37
A simplified example of redux + redux-simple-router using Typescript
/**
WHAT: A very simple example of redux + redux-simple-router using Typescript.
WHY: The official example found here: https://github.com/rackt/redux-simple-router/tree/1.0.2/examples/basic has problems:
1) it is spread over many files making it very hard to "skim"
2) it is organized by function, not by feature. (Example: learning "how to manipulate redux state" is spread over 5 files in 4 folders)
3) there are no comments explaining what's going on/why.
WHO: by JasonS@Novaleaf.com
@joshfarrant
joshfarrant / puck.js
Created May 8, 2017 08:14
Puck.js example code
const UUIDS = {
INFO: 0x180A,
TEMPERATURE: 0x1809,
BATTERY: 0x180F,
};
const mainLoopTimeout = 60000;
const buttonPressTimeout = 5000;
const buttonInitialValue = 0;
const buttonValueIncrement = 10;
@roboshoes
roboshoes / tween.js
Last active January 25, 2018 18:19
Small tweening function for the quick tween.
export function tween( time, update ) {
const start = Date.now();
var isCanceled = false;
var isComplete = false;
var chain = [];
function loop() {
if ( isCanceled ) return;
@ericdke
ericdke / getDoNotDisturbState.swift
Last active February 8, 2018 20:35
Swift: get the Mac's "Do not disturb" state
if let uuid = getSystemUUID() {
let filepath = ("~/Library/Preferences/ByHost/com.apple.notificationcenterui.\(uuid).plist" as NSString).stringByExpandingTildeInPath
if let dict = NSDictionary(contentsOfFile: filepath), doNotDisturbState = dict["doNotDisturb"] as? Bool {
print(doNotDisturbState)
}
}
//--------------------------------------------------------------------------//
// Flow field animator by Etienne Jacob (www.necessary-disorder.tumblr.com) //
// Processing code (https://processing.org) //
// Saves frames, then you must use something else to make the GIF //
//--------------------------------------------------------------------------//
/// This code starts with the rendering system I took from @beesandbombs
/// (it also contains some useful functions and stuff)
/// You don't have to understand it
/// Just know that it does an average on many drawings to get a motion blur effect
/// from drawings parametrized by the global variable t going from 0 to 1