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 app = angular.module('myApp', []); | |
/* Set up a simple controller with a few | |
* examples of common actions a controller function | |
* might set up on a $scope. */ | |
app.controller('MainCtrl', function($scope, someService) { | |
//set some properties | |
$scope.foo = 'foo'; | |
$scope.bar = 'bar'; |
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
angular.module('ionic.utils', []) | |
.factory('$localstorage', ['$window', function($window) { | |
return { | |
set: function(key, value) { | |
$window.localStorage[key] = value; | |
}, | |
get: function(key, defaultValue) { | |
return $window.localStorage[key] || defaultValue; | |
}, |
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
(require 'evil) | |
(require 'evil-leader) | |
(require 'evil-surround) | |
(require 'evil-matchit) | |
(global-evil-matchit-mode t) | |
(evil-mode t) | |
(global-evil-leader-mode t) | |
(global-evil-surround-mode t) |
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
#compdef docker | |
if (( CURRENT == 2 )); then | |
compadd $(docker ps -aq | xargs docker inspect --format '{{.Name}}' | cut -d "/" -f 2) | |
fi |
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 grep for file type | |
git grep res -- '*.js' |
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
" copy a specific line in relativenumber mode and paste to current line | |
:<-/+ line>t. |
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
# rewrite url agnostic | |
html.gsub(/https?:\/\//, '//') | |
# build ruby from source | |
ruby_version=ruby-2.0.0-p451 && wget -c http://cache.ruby-lang.org/pub/ruby/2.0/$ruby_version.tar.gz && tar xvfz $ruby_version.tar.gz &&\ | |
cd $ruby_version && ./configure --disable-install-rdoc && make install &&\ | |
cd .. && rm -rf $ruby_version* |
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
## some useful aliases | |
alias ls "ls -h" | |
alias dir ls | |
alias less more | |
alias zless zmore | |
alias bzless bzmore | |
alias mirror "mirror -v" | |
alias sync "mirror -R -v -n" | |
alias reconnect "close; cache flush; cd ." | |
alias edit "eval -f \"get $0 -o ~/.lftp/edit.tmp.$$ && shell \\\"cp -p ~/.lftp/edit.tmp.$$ ~/.lftp/edit.tmp.$$.orig && $EDITOR ~/.lftp/edit.tmp.$$ && test ~/.lftp/edit.tmp.$$ -nt ~/.lftp/edit.tmp.$$.orig\\\" && put ~/.lftp/edit.tmp.$$ -o $0; shell rm -f ~/.lftp/edit.tmp.$$*\"" |
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
# backup database from one host to another | |
pg_dump --no-owner --no-acl <db-name> > backup | |
psql <to-db-name> < backup > /dev/null |
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
# convert mp4 to mp3 | |
# source https://trac.ffmpeg.org/wiki/Encoding%20VBR%20(Variable%20Bit%20Rate)%20mp3%20audio | |
ffmpeg -i k.mp4 -q:a 0 -map a k.mp3 | |