Skip to content

Instantly share code, notes, and snippets.

// LikePhoto.js
exports.main = function(request, response){
var query = new Parse.Query("Photo");
var objid = request.params.objectid;
return query.get(objid)
// Photo
.then(function(photo) {
@tomasdev
tomasdev / .jshintrc
Created February 4, 2014 19:22
Gulp FTW.
{
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"forin": true,
"immed": true,
"indent": 4,
"latedef": true,
"maxparams": 3,
@tomasdev
tomasdev / WTF.txt
Created March 11, 2015 16:45
The character between A and B is invisible in most text editors, except vim.
A
B
var fetchAll = function () {
var deferred = Q.defer(),
parsedCount = 0,
allData = [];
var addData = function (err, data) {
parsedCount += 5;
if (err) {
console.error(err);
@tomasdev
tomasdev / dabblet.css
Created September 22, 2015 19:08
Untitled
figure:after { background: rgba(255, 255, 255, 0.1); content: ""; display: block; height: 100%; left: 0; opacity: 0; position: absolute; top: 0; width: 100%; z-index: 4; -webkit-transition: opacity 0.6s ease; transition: opacity 0.6s ease;}figure:hover:after { opacity: 1;}figure:hover img { -webkit-filter: blur(10px) grayscale(1); filter: blur(10px) grayscale(1);}figure:hover figcaption { -ms-transform: translateX(0); -webkit-transform: translateX(0); transform: translateX(0);}figcaption { font: 36px/1.6 Oswald, sans-serif; left: 0; padding: 100px 0 0 50px; position: absolute; text-transform: uppercase; top: 0; z-index: 5; -ms-transform: translateX(-100%); -webkit-transform: translateX(-100%); transform: translateX(-100%); -webkit-transition: all 0.3s ease; transition: all 0.3s ease;}figcaption:before { content: "“"; display: block; font-size: 100px; line-height: 10px; margin: 0 0 -20px -5px;}img { max-width: 100%; position: relative; z-index: 3; -webkit-transiti
@tomasdev
tomasdev / dabblet.css
Last active September 22, 2015 19:11
Untitled
figure:after { background: rgba(255, 255, 255, 0.5); content: ""; display: block; height: 100%; left: 0; opacity: 0; position: absolute; top: 0; width: 100%; z-index: 4; -webkit-transition: opacity 0.6s ease; transition: opacity 0.6s ease;}figure:hover:after { opacity: 1;}figure:hover img { -webkit-filter: grayscale(1); filter: grayscale(1);}figure:hover figcaption { -ms-transform: translateX(0); -webkit-transform: translateX(0); transform: translateX(0);}figcaption { font: 36px/1.6 Oswald, sans-serif; left: 0; padding: 100px 0 0 50px; position: absolute; text-transform: uppercase; top: 0; z-index: 5; -ms-transform: translateX(-100%); -webkit-transform: translateX(-100%); transform: translateX(-100%); -webkit-transition: all 0.3s ease; transition: all 0.3s ease;}figcaption:before { content: "“"; display: block; font-size: 100px; line-height: 10px; margin: 0 0 -20px -5px;}img { max-width: 100%; position: relative; z-index: 3; -webkit-transition: all 1s ease; tran
@tomasdev
tomasdev / gist:1459269
Created December 11, 2011 08:07
writing my name obfuscating JS
// the M is the problem.
var tomas = ([!![]]+[])[+[]]+([]+{})[+!![]]+((+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!+[]+[])[+[]]+(!+[]+[])[!+[]+!+[]+!+[]]+(!+[]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!+[]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!+[]+[])[+[]]+(!+[]+[])[!+[]+!+[]+!+[]]+(!+[]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!+[]+[])[+[]]+(!+[]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!+[]+[])[+[]]+(!+[]+[])[!+[]+!+[]+!+[]]+(!+[]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!+[]+[])[+[]]+(!+[]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!+[]+[])[+[]]+(!+[]+[])[!+[]+!+[]+!+[]]+(!+[]+[])[+!+[]]])[+!+[]+[+[]]]+(!+[]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(![]+[])[+!![]]+(![]+[])[-~-~+!![]];
// ta-da
console.log(tomas);
@tomasdev
tomasdev / splitAll.js
Created December 20, 2011 03:56
String multiple split
String.prototype.splitAll = function(){
var i = arguments.length,
original = this,
str = arguments[--i];
for( ; str ; ){
original = original.split(str);
(str = arguments[--i]) && (original = original.join(str));
}
return original;
}
@tomasdev
tomasdev / byCOWBOY
Created January 2, 2012 20:59
update chromium
#!/bin/bash
if [[ "$1" == "-h" || "$1" == "--help" ]]; then cat <<HELP
Chromium Updater
http://benalman.com/
Usage: $(basename "$0") [revision]
Download and install the latest Chromium and dev tools, modifying the binary
to use those custom dev tools (downloaded into ~/.dotfiles/caches/chromium).
@@ -339,6 +339,12 @@ var Cufon = (function() {
return glyphs;
})(data.glyphs);
+ this.missingGlyphs = '';
+ for (var i in this.glyphs) {
+ this.missingGlyphs += i;
+ }
+ this.missingGlyphsRegexp = new RegExp("[^" + this.missingGlyphs.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") + "]");
+