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
-- add users: | |
-- $ htpasswd -s -c /etc/nginx-rtmp/.htpasswd streamname | |
-- stream: | |
-- $ ffmpeg -i foo.mp4 -c copy -f flv rtmp://abc.de/streamname?auth=password | |
local users = {} | |
for line in io.lines("/etc/nginx-rtmp/.htpasswd") do | |
local user, pass = line:match("([^:]+):{SHA}([^\n]+)") | |
users[user] = pass | |
end |
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
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
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
module Request | |
[:get, :post, :put, :delete].each do |verb| | |
define_method verb do |url, payload: {}, headers: {}| | |
headers = define_headers(headers) | |
execute(verb, url, payload, headers) | |
end | |
end | |
def define_headers(headers) | |
default_headers = { |
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
module Request | |
def get(url, payload: {}, headers: {}) | |
headers = define_headers(headers) | |
execute(:get, url, payload, headers) | |
end | |
def post(url, payload: {}, headers: {}) | |
headers = define_headers(headers) | |
execute(:post, url, payload, headers) | |
end |
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-option -g default-shell /usr/local/bin/zsh | |
set -g default-terminal "screen-256color" | |
set -g repeat-time 125 | |
set -g base-index 1 # count from 1 | |
set-option -g allow-rename off | |
set -s escape-time 0 | |
#Change prefix key to backtick (`) | |
unbind C-b | |
set-option -g prefix ` |
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
require 'rspec' | |
class Stats | |
def self.mean(array) | |
array.inject(:+) / array.size.to_f | |
end | |
def self.median(array) | |
mid = array.length / 2 | |
sorted = array.sort |
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 app = require('express')(); | |
var http = require('http').Server(app); | |
var io = require('socket.io')(http); | |
app.get('/', function(req, res){ | |
res.send('<h1>Hello world</h1>'); | |
}); | |
io.on('connection', function(socket){ | |
console.log('a user connected'); |
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
# encoding: utf-8 | |
site 'http://community.opscode.com/api/v1' | |
cookbook "apt" | |
cookbook "nodejs", {:github=>"mdxp/nodejs-cookbook"} | |
cookbook "mysql", {} | |
cookbook "vim", {} | |
cookbook "build-essential", {} | |
cookbook "rvm", {:github=>"fnichol/chef-rvm", :ref=>"v0.9.0"} |
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
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |