View objects.js
var a = function(y) {
var z = 1; //shared between instances, accessible via prototype method
var x = 2; //shared between instances
var self = this;
this.y = null; //not shared
var impl = function(y) {
};
var init = function(y) {
View gist:d0e6727e42fc2c504734
*** 1. Remove --no-act for run the commands for real.
*** 2. Find out the range of your kernel version numbers and replace the numbers below. e.g. {start..end}
Finding out versions:
dpkg -l | grep linux-image
Purging the images:
sudo dpkg -P --no-act --force-depends linux-image-3.13.0-{32..46}-generic
sudo dpkg -P --no-act --force-depends linux-image-extra-3.13.0-{32..46}-generic
sudo dpkg -P --no-act --force-depends linux-headers-3.13.0-{32..46}-generic
View README.md
View gist:1a087fe39e67aae7910f
app.directive("child", function() {
return {
...
require: ["^parent", "child"],
link: function(scope, elem, attrs, ctrls) {
var parentController = ctrls[0],
childController = ctrls[1];
childController.setParent(parentController);
},
View gist:84c8e509170849631a8d
rm -rf ~/.gnupg/
curl -#LO https://rvm.io/mpapis.asc
gpg --import mpapis.asc
\curl -sSL https://get.rvm.io | bash -s stable
View gist:938c247f3e418bb96d9e
Go to Visual Studio Tools > start Developer Command Prompt for VS2013
msbuild yourprojectname.build /target:buildall /property:BUILD_NUMBER=1
View gist:069becb4a3482968cc19
#!bin/bash
#set -xv
cpSource='your/root/folderxxx'
cpDest='your/root/folderxxx'
verbose=false
case "$1" in
-v)
verbose=true;;
View gist:9944c36d508e568b9126
# Cygwin's cp discards ACLs (complex windows permissions). You have to copy them separately as follows:
# First copy files themselves, with timestamps:
cp -a folder1 folder2
# Set all ACLs of copies to ACLs of originals:
cd folder2
find . | while read f ; do getfacl ../folder1/"$f" | setfacl -f - "$f" ; done
# or when permissions are equal for all files / directories:
getfacl folder1 > folder-perms
View gist:f08c526c9c39e9646357
$ a=/cygdrive/c/projects/sandbox/projects
##match pattern from the left hand side. Double # means greedy.
hsuh@hsuh /cygdrive/c/projects/sandbox/projects
$ echo ${a##*sandbox}
/projects
##match pattern from the right hand side. Double % means greedy.
hsuh@hsuh /cygdrive/c/projects/sandbox/projects
$ echo ${a%%proj*}
View csvDownload.js
var msiversion = function msieversion() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer, return version number
{
return true;
} else { // If another browser,
return false;
}
return false;