Skip to content

Instantly share code, notes, and snippets.

@brianleroux
brianleroux / lawnchair-examples.js
Created January 27, 2011 06:32
examples for using lawnchair js
// create a new store
var store = new Lawnchair({adaptor:'dom', table:'people'});
// saving documents
store.save({name:'brian'});
// optionally pass a key
store.save({key:'config', settings:{color:'blue'}});
// updating a document in place is the same syntax
@ssheduardo
ssheduardo / Fetch sublime settings
Created April 5, 2012 11:51
Fetch sublime settings
{
"files":
{
"backbone": "http://documentcloud.github.com/backbone/backbone.js",
"backbone-min": "http://documentcloud.github.com/backbone/backbone-min.js",
"jquery": "http://code.jquery.com/jquery.min.js",
"json2": "https://github.com/douglascrockford/JSON-js/raw/master/json2.js",
"normalize": "https://raw.github.com/necolas/normalize.css/master/normalize.css",
"raphael": "http://github.com/DmitryBaranovskiy/raphael/raw/master/raphael-min.js",
"reset": "http://meyerweb.com/eric/tools/css/reset/reset.css",
@sineld
sineld / laravel-upload-resize.php
Created September 25, 2012 08:11
Laravel File Upload And Resize
<?php
// Resizer and Image Manipulation
// Based on: http://forums.laravel.com/viewtopic.php?id=2648
public function post_edit_logo($id)
{
$rules = array(
'image' => 'image',
);
@ScrambledBits
ScrambledBits / Fetch.jq
Last active February 1, 2016 21:36
Fetch.sublime-settings
{
"files":
{
"Dojo": "http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js",
"MooTools": "http://mootools.net/download/get/mootools-core-1.4.5-full-compat-yc.js",
"PrototypeJS": "https://ajax.googleapis.com/ajax/libs/prototype/1.7.0.0/prototype.js",
"jQuery": "http://code.jquery.com/jquery.min.js",
"jQueryUI": "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js",
"normalize.css": "https://github.com/necolas/normalize.css/raw/master/normalize.css",
"jquery": "http://code.jquery.com/jquery.min.js",
@roine
roine / controllerSpec.js
Last active May 18, 2016 10:49
Some notes on testing AngularJs with Jasmine and Karma.
describe('controllerCtrl', function () {
var $controller,
$rootScope,
$scope;
beforeEach(module('controller'));
beforeEach(inject(function ($injector) {
$controller = $injector.get('$controller');
$rootScope = $injector.get('$rootScope');
@alexandregz
alexandregz / .profile
Last active May 27, 2016 22:32
to add to .profile (ash shell used with Synology NAS)
# place to git, ipkg, another shell commands
PATH=/volume1/@optware/bin:$PATH
export PATH
# more useful prompt shell
#PS1="`hostname`> "
PS1='\u@\h:\w'
case `id -u` in
0) PS1="${PS1}# ";;
@fpirsch
fpirsch / toHaveClass.js
Created September 30, 2014 14:02
Protractor/jasmine toHaveClass custom matcher
/**
* Custom "toHaveClass" matcher.
*
* Based on https://gist.github.com/darthwade/9305669
* and https://gist.github.com/elgalu/94284ec0ac3e8a590507
*
* usage :
* require('./toHaveClass.js');
* ...
* expect($('html')).toHaveClass('wf-active');
@jehoshua02
jehoshua02 / .bash_alias_composer
Created October 4, 2012 05:32
Bash aliases for Composer
alias composer='php composer.phar'
alias composerinit='curl -s http://getcomposer.org/installer | php; composer init; echo composer.phar >> .gitignore'
alias composerdump='composer dumpautoload --optimize'
@Kerry350
Kerry350 / git-commands.mkd
Last active April 23, 2020 04:23
Common Git commands

A little lookup for commands I use frequently

  • Commit all edited files and add a message

git commit -a -m "My commit"

  • Add all new files

git add .

@jeffjohnson9046
jeffjohnson9046 / title-case-filter.js
Created March 26, 2014 18:22
A title-case filter for AngularJs
// Came from the comments here: https://gist.github.com/maruf-nc/5625869
app.filter('titlecase', function() {
return function (input) {
var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
input = input.toLowerCase();
return input.replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function(match, index, title) {
if (index > 0 && index + match.length !== title.length &&
match.search(smallWords) > -1 && title.charAt(index - 2) !== ":" &&
(title.charAt(index + match.length) !== '-' || title.charAt(index - 1) === '-') &&