Skip to content

Instantly share code, notes, and snippets.

View jeppeburchardt's full-sized avatar

Jeppe Burchardt jeppeburchardt

View GitHub Profile
console.profile();
let i = 0;
let id = setInterval(() => {
const url = ++i % 2 ? '/details/52176516' : '/details/52262234';
store.dispatch({ type: '@@history/NAVIGATE', url });
if (i > 25) {
clearInterval(id);
console.profileEnd();
alert('Profiling complete!');
}
@jeppeburchardt
jeppeburchardt / disk.sh
Created June 9, 2016 12:40
Setup RAM disk, install repo and start rsync
diskutil erasevolume HFS+ 'TSRAM' `hdiutil attach -nomount ram://4194304`
cd /Volumes/TSRAM && pwd
git clone [email protected]:trendsales/frontend-architecture.git
cd frontend-architecture && pwd
npm install
./sync.sh
.hairlines(@border) {
border-width: @border;
.subpixel-support & {
border-width: ~`"@{border}".replace(/1px/g, "0.5px").replace(/[\[\],]/g, '')`;
}
}
.border-a {
.hairlines(2px 1px 0px 10px);
}
.border-b {
@jeppeburchardt
jeppeburchardt / vanilla-class.js
Created April 9, 2014 15:21
js vanilla class example
function inherits(Parent, Child) {
function F() {}
F.prototype = Parent;
Child.prototype = new F();
};
var VanillaClass = function () {
var self = this;
self.name = "VanillaClass";
self.listeners = {};
@jeppeburchardt
jeppeburchardt / msbuild node gyp
Created July 17, 2013 12:54
node gyp msbuild misssing registry warning MSB8003: Could not find WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid version number
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\Setenv.cmd" /Release /x86
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\Setenv.cmd" /Release /x64
* {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 1.4em;
}
.head {
font-size: 36px;
word-spacing: -0.05em;
letter-spacing: -3px;
@jeppeburchardt
jeppeburchardt / proxy.js
Created January 24, 2013 12:59
jQuery equivalent of MooTools bind
$("#button").click($.proxy(function () {
//use original 'this'
},this));
@jeppeburchardt
jeppeburchardt / serial.py
Last active April 13, 2018 16:03
python arduino usb serial example
import serial
from time import sleep
usb_ports = ('/dev/ttyUSB0', '/dev/ttyUSB1')
while 1:
for usb in usb_ports:
try:
#print('Connecting to arduino at ' + usb)
auduino = serial.Serial(usb, 9600)