This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git rm --cached *.pyc | |
or | |
git update-index --assume-unchanged *.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git reset --soft HEAD~3 && git commit -m"Squashing last 3 commits" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE DBNAME.TableName | |
SET DBNAME.TableName = REPLACE(DBNAME.TableName.FieldName,'OldString','NewString') | |
WHERE DBNAME.TableName.FieldName like '%OldString%'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express') | |
, cookieSessions = require('./cookie-sessions'); | |
var app = express(); | |
app.use(express.cookieParser('manny is cool')); | |
app.use(cookieSessions('sid')); | |
app.get('/', function(req, res){ | |
req.session.count = req.session.count || 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// typeof operator reports arrays as 'object' | |
// this function can be used to determine if the value is an array or not. | |
var is_array = function (value) { | |
return Object.prototype.toString.apply(value) === '[object Array]'; | |
}; | |
var ar1 = ['abc', 'def', 'hij']; // array | |
var ob1 = {'0': 'abc', '1': 'def', '2': 'hij'}; // object | |
var va1 = 'abcdefhij'; // string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ng\:cloak], [ng-cloak], [data-ng-cloak], .ng-cloak, .x-ng-cloak { | |
display: none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo npm cache clean -f | |
sudo npm install -g n | |
sudo n stable | |
node -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//extend jquery with function to check if element exists | |
$.fn.exists = function(){ | |
return this.length > 0 ? this : false; | |
} | |
//usage | |
$('.matchme').exists(); //returns reference to element if exists otherwise false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$._data( $(selector)[0], "events" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Kestrel | |
const K = ( x ) => ( y ) => x; | |
// Identity | |
const I = ( x ) => x; | |
// Vireo | |
const V = ( x ) => ( y ) => ( z ) => z( x )( z ); | |
// Thrush | |
const T = ( x ) => ( y ) => y( x ), x; | |
// Why | |
const Y = ( x ) => ( ( y ) => y( y ) )( ( y ) => ( x( ( z ) => y( y )( z ) ) ) ); |