This file contains hidden or 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
| #!/bin/bash | |
| SED_HOME=$(echo $HOME | sed -e 's/\//\\\//g') | |
| REPLACE_CMD="s/(.*):(.*)\"(.*)\.docker\/(.*)/\1:\2\"$SED_HOME\/.docker\/\4/" | |
| sed -i '' -E -e $REPLACE_CMD $(find $PWD -name config.json) |
This file contains hidden or 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
| /* | |
| * Redux async actions examples | |
| * | |
| * Install | |
| npm install bluebird redux redux-thunk | |
| */ | |
| const Promise = require('bluebird'); |
This file contains hidden or 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 crypto = require('crypto'); | |
| var mailgunSignature = function(mailgunApiKey) { | |
| var token = crypto.randomBytes(25).toString('hex'); | |
| var timestamp = Math.floor(Date.now() / 1000); | |
| return { | |
| token: token, | |
| timestamp: timestamp, |
This file contains hidden or 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
| fzapp.directive('xspin', [function() { | |
| return { | |
| scope: true, | |
| link: function(scope, element, attrs) { | |
| var spinner, options = {lines:10, width: 1, length: 1, radius: 7}; | |
| if (attrs.xspin) { | |
| options = angular.extend(options, angular.fromJson(attrs.xspin)); |
This file contains hidden or 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
| // set chunk size | |
| var chunkSize = 1024 * 1024 * 2; // 2Mb | |
| // file from input | |
| var readChunks = function(file) { | |
| var parts = []; | |
| var start = 0; | |
| var stop = chunkSize - 1; | |
| var chunksLength = Math.ceil(file.size / chunkSize); |
This file contains hidden or 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
| # creates a pipe that only allows up to 15KB/s to go through. | |
| sudo ipfw pipe 1 config bw 15KByte/s | |
| # will attach that pipe to the outgoing traffic on port 80, effectively limiting the outgoing traffic of the web server. | |
| sudo ipfw add 1 pipe 1 src-port 80 | |
| # will remove the pipe from the port. | |
| sudo ipfw delete 1 |
This file contains hidden or 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
| [user] | |
| name = User Name | |
| email = [email protected] | |
| [alias] | |
| co = checkout | |
| br = branch | |
| st = status | |
| cm = commit -m | |
| cam = commit --amend | |
| ds = diff --staged |
This file contains hidden or 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
| // x - project | |
| // required install uglifyjs, less (via npm better way))) | |
| // | |
| // sudo npm install less uglifyjs -g | |
| git clone git://github.com/twitter/bootstrap.git | |
| cd bootstrap | |
| mkdir -p x/css x/js x/img |
This file contains hidden or 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
| # ubuntu-repair-broken-package | |
| sudo dpkg --force-depends --purge [package] | |
| sudo apt-get autoremove -f | |
| sudo apt-get install [package] | |
| # enable do-release-upgrade command | |
| sudo apt-get install update-manager-core | |
| # enable add-apt-repository command | |
| sudo apt-get install software-properties-common |
This file contains hidden or 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 errorLog = function errorLog(msg, url, line) { | |
| var i = document.createElement('img'); | |
| i.src = '/error/log?msg=' + encodeURIComponent(msg) + '&url=' + encodeURIComponent(url) + '&line=' + encodeURIComponent(line); | |
| }; | |
| window.onerror = errorLog; |