Skip to content

Instantly share code, notes, and snippets.


Paul Stamatiou stammy

View GitHub Profile
stammy / firebase.html
Created Nov 28, 2012
Hello World Firebase
View firebase.html
+1 with firebase. now you just need to write a node app with regression logic
that listens to each new vote on each post and tracks value history to ignore and reset
any malicious db.set(0)'s people run in console when they find this completely
public script on your site. (Firebase is working on their security).
stammy / high-dpi-media.scss
Created Nov 26, 2012 — forked from kimroen/high-dpi-media.scss
A Sass media query mixin that captures almost all high DPI aware devices.
View high-dpi-media.scss
/* ----------------------------------------------------------------------- */
/* */
/* Improved upon a mixin from 37signals and combined */
/* with these numbers from marc. */
/* */
/* 37signals-version: */
/* */
/* */
/* @kimroen */
/* */
View _media-queries.scss
// 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
stammy / 5by5.html
Created Nov 9, 2012
Front-end Challenge: 5x5 grid of blocks that change color when ... (click download and run this in your browser)
View 5by5.html
Create a 5 x 5 grid of blue blocks. When a block is clicked it turns red. Its adjacent block turns green.
If a red block is on the end of a row, the adjacent green block is on the line below on the first column,
et cetera. When another block is clicked, the previous red/green blocks go back to blue. There will only
ever be one red and one green block on the screen, the rest are always blue.
Only worry about Chrome.
stammy /
Created Oct 22, 2012 — forked from domenic/
You're Missing the Point of Promises

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
    // the rest of your code goes here.
stammy /
Created Sep 24, 2012
dotjs file to make pg's essay's a bit more readable
document.getElementsByTagName('font')[0].setAttribute('style', "line-height:1.8; font-size: 16px; color:#444; font-weight:300; font-family: 'Helvetica Neue';");
document.getElementsByTagName('table')[1].style.width = '500px';
stammy / gist:2915921
Created Jun 12, 2012
css3 image mask
View gist:2915921
I had a background image that I wanted to apply border-radius to-- which you can't do to a background image. masks to the rescue! I opted for a method that didn't require an image mask overlay.
radial gradient params: (x/y positioning, width/height, how sharp you want the edges to be, dont mess with last value)
-webkit-mask-box-image: -webkit-radial-gradient(19px 19px, 19px 19px, black 92%, transparent 100%)
stammy /
Created May 7, 2012 — forked from jimtla/
Add CoffeeScript friendly argument order to Underscore.js
# Five lines of code that will make your underscore + CoffeeScript use cleaner.
# Creates an underscore function for each function in to_reverse with R (short for Reversed) appended to the name.
# The R version moves the function argument (first argument in normal underscore) to the end,
# so you can write:
$(window).scroll _.throttleR 500, ->
console.log "This print's at most every 500ms"
# Instead of:
$(window).scroll _.throttle ->
console.log "This prints at most every 500ms too"
stammy / gist:2494287
Created Apr 25, 2012
asset precompilation error on requirejs-rails
View gist:2494287
$ bundle exec rake assets:precompile
/Users/Stammy/.rvm/rubies/ruby-1.9.3-p0-perf/bin/ruby /Users/Stammy/.rvm/gems/ruby-1.9.3-p0-perf/bin/rake requirejs:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
throw e; // process.nextTick error, or 'error' event on first tick
Error: ENOENT, no such file or directory '/Users/Stammy/code/picplum/app/assets/javascripts/app/strobeo.js'
at Object.openSync (fs.js:230:18)
at Object.readFileSync (fs.js:120:15)
at Object.readFile (/Users/Stammy/.rvm/gems/ruby-1.9.3-p0-perf/gems/requirejs-rails-0.7.3/bin/r.js:2707:27)
View main.js
paths: {
jquery: '',
jqueryui: '',
json2: 'libs/json2',
underscore: "libs/underscore_132",
backbone: "libs/backbone_92",
order: 'order',
// uploader
fileupload: 'libs/jquery.fileupload',