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
# force HTTP to HTTPS - /etc/nginx/conf.d/nonssl.conf | |
server { | |
listen 80; | |
server_name jira.example.com; | |
access_log off; | |
return 301 https://$server_name$request_uri; | |
} | |
# /etc/nginx/conf.d/jira.conf | |
server { |
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
To have launchd start telegraf at login: | |
ln -sfv /usr/local/opt/telegraf/*.plist ~/Library/LaunchAgents | |
Then to load telegraf now: | |
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.telegraf.plist | |
Or, if you don't want/need launchctl, you can just run: | |
telegraf -config /usr/local/etc/telegraf.conf | |
or | |
telegraf -sample-config > telegraf.conf to create an initial configuration | |
Provided that you already have a file or stream segmenter generating your .m3u8 playlist and .ts segment files (such as the ffmpeg 'hls' muxer), this little node server will serve up those files to an HLS compatible client (e.g. Safari). If you're using node for your streaming app already, this obviates the need to serve the HLS stream from a separate web server.
loosely based on https://gist.github.com/bnerd/2011232
// loosely based on https://gist.github.com/bnerd/2011232
// requires node.js >= v0.10.0
// assumes that HLS segmenter filename base is 'out'
// and that the HLS playlist and .ts files are in the current directory
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
npm uninstall -g phantomjs | |
npm cache clean -f | |
brew upgrade nodejs | |
rm -rf node_modules | |
npm install -g YOUR_GLOBAL_DEPENDENCIES | |
npm install |
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 Promise = require('bluebird'); | |
var promises = []; | |
for(var i = 0 ; i<10; i++) { | |
var that = this; | |
promises.push(new Promise(function(fulfill, reject) { | |
setTimeout(function(){ | |
console.log('Fulfill '); | |
fulfill(); | |
}, 1000+Math.random()*10000); | |
})); |
Nowadays, being really busy has become something worth bragging about or something you can't escape.
You will probably even blame your commitments for stealing your time.
But is it truly impossible for you to make time for your "dream project"?
Are you busy or is it avoidance?
Really. Look at your schedule; and put in a little "dream" time.
Everything else would benefit more if you spend some time caring for your passions ;)
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 | |
# ./captureHls.sh http://www.cdn.com/master.m3u8 DIRECTORY | |
URL=$1 | |
OUTPUT=$2 | |
# create output directory | |
if [ -d $OUTPUT ] | |
then | |
echo "Directory $OUTPUT already exists" |
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
#!/usr/bin/env node | |
/** | |
Demostrate a practical use case with Bluebird promise api. | |
Read a line delimited file and store into sqlite3 db. | |
Promise.promisifyAll - Converting synchromous api's to Async. | |
Promise.using and Promise.disposer - Resource managment. | |
Promise.map and Promise.spread - Leveraging arrays in promises. |
Open a new Terminal window and run the following command:
sudo gedit /etc/apt/sources.list.d/google.list
In the text file that opens edit the file so that the line reads:
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main