Skip to content

Instantly share code, notes, and snippets.

View brianleroux's full-sized avatar
💚
You are now aware that you are breathing

Brian LeRoux brianleroux

💚
You are now aware that you are breathing
View GitHub Profile
@balupton
balupton / README.md
Last active September 29, 2018 18:31
Responsive layouts in stylus

Responsive layouts in stylus

Why this way?

  1. There is no span1..15 styles, instead your css defines your layout and your html remains semantic and not polluted with display information. As it should be.

  2. The markup is incredibly easy, you specify the wrappers width, and then each columns width in percentages. Every other grid framework I've found is incredibly complicated with this.

  3. It allows you to have the exact same markup, and completely different styles for different devices, resolutions, stylesheets, whatever. As it should be.

@filmaj
filmaj / index.html
Created July 1, 2011 01:14
Rotation of elements in PhoneGap using CSS transform and PhoneGap Compass API
<html>
<head>
<title>Compass Test</title>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, target-densityDpi=device-dpi" />
<script type="text/javascript" src="phonegap.0.9.6.1.js"></script>
<script type="text/javascript">
var d = -45,
e = null,
w = null;
function win(h) {
@topfunky
topfunky / Cakefile
Created April 14, 2011 22:18
Watch both Sass and Coffee files and compile on change (for Node.js)
###
Modified from https://github.com/jashkenas/coffee-script/blob/master/Cakefile
Part of an upcoming PeepCode screencast. This snippet is MIT Licensed.
###
{spawn, exec} = require 'child_process'
task 'assets:watch', 'Watch source files and build JS & CSS', (options) ->
runCommand = (name, args) ->
@aaronrussell
aaronrussell / jquery.mobile.event.js
Created December 16, 2010 13:36
Slightly modified version of jQuery Mobile's event handlers so can be used standalone without the rest of the framework
/*
* jQuery Mobile Framework : events
* Copyright (c) jQuery Project
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function($, undefined ) {
$.extend( $.support, {
orientation: "orientation" in window,
@3rd-Eden
3rd-Eden / server.js
Created December 12, 2010 22:36
Running HTTPS and HTTP over the same route using the EventEmitter
// Include required modules
var crypto = require( "crypto" )
, http = require( "http" )
, fs = require( "fs" );
// Build our default app, just like would normally do
var app = http.createServer(function (req, res) {
res.writeHead(200, { "Content-Type": "text/plain" } );
res.end( "Double http server, over http and https\n" );
});
@shripadk
shripadk / gist:652819
Created October 29, 2010 03:10
Express authentication using Redis for session store and Couchdb for database (in coffeescript!)
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'

Module Constructor

This is a proposal for the inclusion of an additional primordial variable to all ECMAScript contexts.

  • There MUST be a primordial function Module(text, fileName, lineNo)
    • text MUST be parsed the body of a strict-mode Function
    • Module MAY throw a SyntaxError
    • fileName is an optional name for the text, for debuggers
  • lineNo defaults to 1, is coerced to Number internally, and represents the line
function Cache() { }
Cache.prototype.getCachedPathForURI = function(uri, success, fail) {
return PhoneGap.execAsync(function(args) {
success(uri, args.file);
}, function(args) {
fail(uri, args.message);
}, 'com.example.URLCache', 'getCachedPathForURI', [uri, 'FOO']);
};
@davejohnson
davejohnson / Android-plugin-java-example
Created September 3, 2010 22:21
phonegap-android-plugin-java-example
package com.example;
import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
Object.defineProperty(Object.prototype, "extend", {value: function (obj) {
obj.__proto__ = this;
return obj;
}});
Object.defineProperty(Object.prototype, "new", {value: function () {
var obj = Object.create(this);
if (obj.initialize) obj.initialize.apply(obj, arguments);
return obj;
}});