Skip to content

Instantly share code, notes, and snippets.

View loadedsith's full-sized avatar

Graham P Heath loadedsith

View GitHub Profile
@iliakarasin
iliakarasin / _helpers.scss
Last active June 6, 2018 06:49
Helper mixins
// Center
@mixin center($direction, $position:'absolute') {
@if $direction == x {
left: 50%;
position: if($position == relative, relative, absolute);
-webkit-transform: translateX(-50%);
-ms-transform: translateX(-50%);
transform: translateX(-50%);
} @else if $direction == y {
position: if($position == relative, relative, absolute);
@eculver
eculver / protocol-fix.txt
Created March 16, 2015 18:54
How to deal with tmux "protocol version mismatch"
$ tmux attach
protocol version mismatch (client 7, server 6)
$ pgrep tmux
3429
$ /proc/3429/exe attach
@katowulf
katowulf / 1_query_timestamp.js
Last active September 21, 2023 20:28
Get only new items from Firebase
// assumes you add a timestamp field to each record (see Firebase.ServerValue.TIMESTAMP)
// pros: fast and done server-side (less bandwidth, faster response), simple
// cons: a few bytes on each record for the timestamp
var ref = new Firebase(...);
ref.orderByChild('timestamp').startAt(Date.now()).on('child_added', function(snapshot) {
console.log('new record', snap.key());
});