Skip to content

Instantly share code, notes, and snippets.

View ungoldman's full-sized avatar
🤔
💭

Nate Goldman ungoldman

🤔
💭
View GitHub Profile

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@ddemaree
ddemaree / application.js.coffee
Created June 12, 2011 21:54
Simple Google Maps API v3 integration in CoffeeScript, with non-JS Static Maps fallback
#= require jquery
#= require jquery_ujs
#= require lib/modernizr
#= require lib/jquery.lettering
#= require_tree .
$ ->
$('*[data-googlemap]').googleMap()
true
@priithaamer
priithaamer / gist:1034070
Created June 19, 2011 11:01
Capistrano task to ask confirmation before deploying to production
task :ask_production_confirmation do
set(:confirmed) do
puts <<-WARN
========================================================================
WARNING: You're about to perform actions on production server(s)
Please confirm that all your intentions are kind and friendly
========================================================================
@geoloqi
geoloqi / gist:1129641
Created August 6, 2011 19:01
Example code for posting a location update to the Geoloqi API
<?php
// Get a permanent access token from the developers website https://developers.geoloqi.com/getting-started
$permanentToken = '';
$timestamp = time();
$latitude = 45.524;
$longitude = -122.6843;
$speed = 0;
$altitude = 0;
@max-mapper
max-mapper / index.html
Created August 17, 2011 17:12
thenounproject.com auto-nounifier
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<title>Noun thingy!</title>
<script src="http://relaxed.tv/script/lib/jquery-1.6.1.min.js" type="text/javascript"></script>
<script src="http://relaxed.tv/script/lib/jquery.mustache.js" type="text/javascript"></script>
<script src="http://relaxed.tv/script/lib/underscore.js" type="text/javascript"></script>
<style type="text/css">
.loading { background-image: url('http://fbi.gov/spinner.gif') }
@forxina
forxina / gist:1232482
Created September 21, 2011 16:05 — forked from tmc/gist:828553
fixed up backbone example to work with Backbone.js 0.5.3
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Backbone example</title>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="underscore.js"></script>
<script type="text/javascript" src="backbone.js"></script>
@max-mapper
max-mapper / readme.md
Created September 28, 2011 02:01
SLEEP - syncable.org

Your API does REST, but can it SLEEP?

SLEEP (Syncable Lightweight Event Emitting Persistence) is an emerging standard for distributed data sync using HTTP and JSON. A generalized version of CouchDB's much lauded built-in replication, SLEEP extends the REST architecture to define a way in which databases can offer syncable JSON APIs that foster open data innovation by allowing developers to replicate entire databases over the net.


SLEEP comes from the Apache CouchDB project which is now widely known for it's multi-master streaming HTTP + JSON replication. This is possible in part because of the CouchDB _changes feed, which is a particular API that lets you see if there have been any changes made to the database since last time you synchronized. CouchDB can efficiently implement the _changes feed because of one subtle difference between it and most other databases: it stores a history of all changes that happen to the database, including deletes.

If you synchronize data from a remote source and then the

@bryfox
bryfox / index.erb
Created October 24, 2011 03:11
One quick & dirty approach for an offline-friendly, frequently-updated page that doesn't require JS.
<!DOCTYPE html>
<html manifest="cache.appcache">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<h1>FreshAppCache</h1>
<h2>Requirements:</h2>
@andrewhavens
andrewhavens / websocket_server.rb
Created November 4, 2011 03:07
Buggy event machine code
require 'rubygems' # I'm getting this error when I try to run this file:
require 'em-websocket' # websocket_server.rb:62: syntax error, unexpected $end, expecting keyword_end
require 'json'
class ChatMessage
attr_accessor :type, :username, :message
def initialize(msg_json)
msg = JSON.parse(msg_json)
@rkh
rkh / Gemfile
Created December 14, 2011 11:16 — forked from blambeau/Gemfile
jquery-sinatra-streaming
source "http://rubygems.org/"
gem "sinatra", "~> 1.3.0"
gem "thin"