Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul Stamatiou stammy

View GitHub Profile
@stammy
stammy / firebase.html
Created Nov 28, 2012
Hello World Firebase
View firebase.html
<html>
<head>
<!--
+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).
https://www.firebase.com/docs/
https://twitter.com/Stammy/status/272576842345615360
-->
@stammy
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: */
/* http://37signals.com/svn/posts/3271-easy-retina-ready-images-using-scss */
/* */
/* @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
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
stammy / promises.md
Created Oct 22, 2012 — forked from domenic/promises.md
You're Missing the Point of Promises
View promises.md

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
stammy / paulgraham.com.js
Created Sep 24, 2012
dotjs file to make pg's essay's a bit more readable
View paulgraham.com.js
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
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
stammy / underscoreR.coffee
Created May 7, 2012 — forked from jimtla/underscoreR.coffee
Add CoffeeScript friendly argument order to Underscore.js
View underscoreR.coffee
# 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
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
node.js:201
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
require.config({
paths: {
jquery: 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min',
jqueryui: 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min',
json2: 'libs/json2',
underscore: "libs/underscore_132",
backbone: "libs/backbone_92",
order: 'order',
// uploader
fileupload: 'libs/jquery.fileupload',
You can’t perform that action at this time.