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
| // Types for the result object with discriminated union | |
| type Success<T> = { | |
| data: T; | |
| error: null; | |
| }; | |
| type Failure<E> = { | |
| data: null; | |
| error: E; | |
| }; |
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 | |
| ### | |
| # | |
| # forked from https://gist.github.com/1264701/08f93534ba177f173b9382b53c419cd0de5b07ea | |
| # | |
| # Ubuntu 14.04 based web server installation script | |
| # Run this by executing the following from a fresh install of Ubuntu 14.04 server: | |
| # | |
| # bash -c "$(curl -fsSL https://gist.githubusercontent.com/simkimsia/691e97f40b2544644f9a/raw/ubuntu14.04-cake2.4.sh)" <mysqlPassword> |
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
Show hidden characters
| { | |
| "jsdocs_align_tags": "no", | |
| "jsdocs_spacer_between_sections": true | |
| } |
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
| curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}' |
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
| app.filter('bytes', function() { | |
| return function(bytes, precision) { | |
| if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-'; | |
| if (typeof precision === 'undefined') precision = 1; | |
| var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'], | |
| number = Math.floor(Math.log(bytes) / Math.log(1024)); | |
| return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number]; | |
| } | |
| }); |
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
| # If you're getting this error trying to use ApacheBench on OS X Lion: | |
| # Benchmarking mwmanning.com (be patient)...apr_socket_recv: Connection reset by peer (54) | |
| # | |
| # You need to download the latest beta version of Apache and rebuild ab. | |
| # Here's how (assuming you have homebrew installed). | |
| # Install Homebrew (https://github.com/mxcl/homebrew) and then the Perl Regex support | |
| brew install pcre | |
| # Download the latest from http://httpd.apache.org/download.cgi, then decompress and compile it |