Why?
Because we wanted to achive the following while developing a webapp using websockets:
Static serving (nginx), Django application (gunicorn) and Websockets service (twisted)
- on the same IP
#!/bin/bash | |
# Written by Andrew McDonough | |
# Prerequisites: xdotool must be installed and in your path (http://tinyurl.com/xdotool) | |
# A simple bash script that uses xdotool to move the window that is currently in focus to different parts of the screen. | |
# Particularly useful for reading web pages with flexible layouts on wide monitors. | |
# Assign the various options to keyboard shortcuts e.g. '<Super>Left' assigned to 'swind left' | |
# See http://tinyurl.com/ubuntukeys for help with assigning keyboard shortcuts. | |
from time import strftime,gmtime,time | |
import urllib2 | |
import hmac | |
import hashlib | |
import base64 | |
import string | |
def publishAmazonSnsMsg(Subject,TopicArn,Message,AWSAccessKeyId,privatekey): | |
#http://docs.amazonwebservices.com/AWSSimpleQueueService/2008-01-01/SQSDeveloperGuide/ | |
amzsnshost = 'sns.us-east-1.amazonaws.com' |
var script = document.createElement("script"); | |
script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"); | |
script.addEventListener('load', function() { | |
var script = document.createElement("script"); | |
document.body.appendChild(script); | |
}, false); | |
document.body.appendChild(script); |
configurations { | |
apt | |
} | |
dependencies { | |
compile 'com.squareup.dagger:dagger:1.1.0' | |
apt 'com.squareup.dagger:dagger-compiler:1.1.0' | |
} | |
android.applicationVariants.all { variant -> |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
'use strict' | |
const timeout = ms => new Promise(res => setTimeout(res, ms)) | |
function convinceMe (convince) { | |
let unixTime = Math.round(+new Date() / 1000) | |
console.log(`Delay ${convince} at ${unixTime}`) | |
} | |
async function delay () { |
Adaptive Streaming has become the neccessity for streaming video and audio. Unfortantely, as of this post, there isn't a whole lot of tutorials that accumulate all of the steps to get this working. Hopefully this post achieves that. This post focuses on using Amazon Web Services (AWS) to transcode for HLS and DASH and be the Content Delivery Network (CDN) that delivers the stream to your web page. We'll be using Video.js for the HTML5 player as well as javascript support libaries to make Video.js work with HLS and DASH.
// Copyright (c) 2017, Ben Noordhuis <[email protected]> | |
// | |
// Permission to use, copy, modify, and/or distribute this software for any | |
// purpose with or without fee is hereby granted, provided that the above | |
// copyright notice and this permission notice appear in all copies. | |
// | |
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
package benchmark | |
// Processor: Intel® Core™ i3-2348M CPU @ 2.30GHz × 4 | |
// Memory: 5.7 GiB | |
// | |
// Benchmarking on 100,000 records | |
// - record key length = 50 | |
// - length of common key (prefix) among all records = 15 | |
// - record value length = 5 | |
// |