Skip to content

Instantly share code, notes, and snippets.

View SimplGy's full-sized avatar

Eric Miller SimplGy

View GitHub Profile
// Make it Nasty
function increment (i) {
i ^= (i & ~-~i) | (~i & -~i)
return i
}

Rough outline of asset deployment strategy

Goals

  • Separate front end "client" deployment and build process from backend deployment.
  • Not necessarily have to create two completely distinct applications (because of authentication difficulties etc), but could go in that direction if needed.
  • Migratable to from the asset pipeline & compatible with rails.
  • Support coffeescript, sass compilation.
  • Allow lightweight "staging" clients to be deployed using the existing backend. Ideally even use the production backend with a development client.
  • Fast compilation and deployment.
@thebyrd
thebyrd / magicMethod.js
Last active December 19, 2015 05:49
Adds jQuery style getters and setters to a given constructor function.
Function.prototype.method = function (name, func) {
this.prototype[name] = func;
return this;
}
var getParamNames = function (func) {
var funStr = func.toString()
return funStr.slice(funStr.indexOf('(')+1, funStr.indexOf(')')).match(/([^\s,]+)/g)
}
@jonschlinkert
jonschlinkert / markdown-cheatsheet.md
Last active April 11, 2024 04:45
A better markdown cheatsheet.
@cimmanon
cimmanon / animationPlay
Last active December 18, 2015 08:09 — forked from SimplGy/animationPlay
@function foo-shadow($color, $size, $layers: 1) {
$transparency: (10 - $layers) * .1;
$opts: ();
@for $i from 1 to $layers {
$opts: append($opts, 0 0 0 ($size * $i) transparentize($color, $transparency + (.1 * $i)), comma);
}
@return $opts;
}
$colorGood: lawngreen;
@chrislkeller
chrislkeller / import_json_appsscript.js
Last active March 25, 2024 19:45
Adds what amounts to an =ImportJSON() function to a Google spreadsheet... To use go to Tools --> Script Editor and add the script and save.
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@christophercliff
christophercliff / Makefile
Created December 14, 2012 00:19
Makefile for deploying a Wintersmith static site to Github Pages without exposing the source (assumes you're using the default build directory).
deploy:
rm -rf ./build
wintersmith build
cd ./build && \
git init . && \
git add . && \
git commit -m "Deploy"; \
git push "git@github.com:{YOUR NAME}/{YOUR REPO}.git" master:gh-pages --force && \
rm -rf .git
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface ErrorFormatter : NSObject
@property (strong, nonatomic) NSError *error;
- (id)initWithError:(NSError *)error;
- (UIAlertView *)alert;
@trey
trey / getbundles.md
Created May 18, 2012 02:32
Installing GetBundles on a Fresh Copy of TextMate

Installing GetBundles on a Fresh Copy of TextMate

$ mkdir -p ~/Library/Application\ Support/TextMate/Bundles
$ cd !$
$ svn co http://svn.textmate.org/trunk/Review/Bundles/GetBundles.tmbundle/
$ osascript -e 'tell app "TextMate" to reload bundles'

Sources

@leommoore
leommoore / nginx_basics.md
Last active March 2, 2024 01:13
Nginx Basics

#Nginx Basics for Ubuntu

Please see http://wiki.nginx.org/Main for more information. See http://arstechnica.com/gadgets/2012/11/how-to-set-up-a-safe-and-secure-web-server/ for a tutorial on how to install Nginx.

##Installation To install, you can install the version which is in the standard Ubuntu repositories but it is normally quite old and will not have the latest security patches. The best way is to update the repositories first:

apt-get update
apt-get install python-software-properties

apt-get upgrade