Skip to content

Instantly share code, notes, and snippets.

View trinidadmauricio's full-sized avatar

trinidadmauricio

View GitHub Profile
@trinidadmauricio
trinidadmauricio / remove blank lines regex.md
Created April 10, 2019 16:24 — forked from fomightez/remove blank lines regex.md
remove all blank lines using regular expressions
@trinidadmauricio
trinidadmauricio / 1_query_timestamp.js
Created June 16, 2017 00:33 — forked from katowulf/1_query_timestamp.js
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());
});
@trinidadmauricio
trinidadmauricio / idea-reset-evaluation.sh
Created February 20, 2017 23:55
reset intellij idea 14 evaluation
#!/bin/bash
echo "removeing evaluation key"
rm ~/.IntelliJIdea15/config/eval/idea15.evaluation.key
echo "resetting evalsprt in options.xml"
sed -i '/evlsprt/d' ~/.IntelliJIdea15/config/options/options.xml
echo "resetting evalsprt in prefs.xml"
sed -i '/evlsprt/d' ~/.java/.userPrefs/prefs.xml
@trinidadmauricio
trinidadmauricio / 0_reuse_code.js
Last active August 29, 2015 14:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console