Install Python
$ brew install readline sqlite gdbm --universal
$ brew install python --universal --framework
$ python --version
Python 2.7.3
Symlinks...
{ | |
"scripts": { | |
"eslint": "LIST=`git diff-index --name-only HEAD | grep .*\\.js | grep -v json`; if [ \"$LIST\" ]; then eslint $LIST; fi" | |
}, | |
"devDependencies": { | |
"pre-commit": "0.0.7", | |
"eslint": "~0.5.1" | |
}, | |
"pre-commit": [ | |
"eslint" |
import pyaudio | |
import wave | |
FORMAT = pyaudio.paInt16 | |
CHANNELS = 2 | |
RATE = 44100 | |
CHUNK = 1024 | |
RECORD_SECONDS = 5 | |
WAVE_OUTPUT_FILENAME = "file.wav" | |
""" | |
=========== | |
Description | |
=========== | |
Simple script to copy and gzip static web files to an AWS S3 bucket. S3 is great for cheap hosting of static web content, but by default it does not gzip CSS and JavaScript, which results in much larger data transfer and longer load times for many applications | |
When using this script CSS and JavaScript files are gzipped in transition, and appropriate headers set as per the technique described here: http://www.jamiebegin.com/serving-compressed-gzipped-static-files-from-amazon-s3-or-cloudfront/ | |
* Files overwrite old versions |
angular.module('module') | |
.factory('myService', function($scope, $http, otherService) { | |
// ... | |
}); | |
// is the same as | |
angular.module('module') | |
.factory('myService', ['$scope', '$http', 'otherService', function(scopy, ಠ_ಠ, $scope) { | |
// scopy == Angular's $scope | |
// ಠ_ಠ == Angular's $http |
from uuid import UUID | |
def validate_uuid4(uuid_string): | |
""" | |
Validate that a UUID string is in | |
fact a valid uuid4. | |
Happily, the uuid module does the actual | |
checking for us. |
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
# generate server.xml with the following command: | |
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
# run as follows: | |
# python simple-https-server.py | |
# then in your browser, visit: | |
# https://localhost:4443 | |
import BaseHTTPServer, SimpleHTTPServer | |
import ssl |
1.ElasticSearch install | |
download: | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.2.tar.gz | |
install: | |
tar -zxvf elasticsearch-0.20.2.tar.gz | |
mv elasticsearch-0.20.2 elasticsearch | |
Edit '/usr/local/elasticsearch/config/elasticsearch.yml': | |
cluster.name: elasticsearch-kibana #In logstash configuration file using the | |
node.name: r6x64o11-pv084 #hostname | |
path.conf: /usr/local/elasticsearch/config #configure file path |
Install Python
$ brew install readline sqlite gdbm --universal
$ brew install python --universal --framework
$ python --version
Python 2.7.3
Symlinks...
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> |