import asyncio
import aiohttp
import urllib
import json
import tqdm
import math
import sys
import ssl
from urllib import request
from urllib import parse
View ems_azure.rb
def vm_start(vm, _options = {})
group = vm.uid_ems.split('\\').first
vmm =
vmm.start(, group)
rescue => err
_log.error "vm=[#{}], error: #{err}"
def vm_stop(vm, _options = {})
group = vm.uid_ems.split('\\').first
View check-default-lang.php
function prefered_language( $available_languages, $http_accept_language = 'auto' ) {
if ( 'auto' == $http_accept_language ) {
// $http_accept_language = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
$http_accept_language = isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : '';
preg_match_all( '/([[:alpha:]]{1,8})(-([[:alpha:]|-]{1,8}))?' . '(\s*;\s*q\s*=\s*(1\.0{0,3}|0\.\d{0,3}))?\s*(,|$)/i', $http_accept_language, $hits, PREG_SET_ORDER );
$bestlang = $available_languages[0];
View gist:6b195eac71217cd6d428
$(window).on('message', function(e) {
var data =;
if (data.method !== 'createIFrame') return;
var proxyUrl = chrome.runtime.getURL('/src/iframeProxy/proxy.html');
EDITOR=`git config --get --global core.editor`
alias gitfix="$EDITOR `git diff --name-status --diff-filter=U | awk 'NF>1{printf \"%s \", \$NF}'`"
View requirejs config
baseUrl: '/javascript',
paths: {
// Vendor Files
'select2': '../vendor/select2-dist/dist/js/select2.min',
'json2': '../vendor/json2/json2',
'tinyMCE': '../vendor/tinymce-dist/jquery.tinymce.min',
'lightbox': '../vendor/lightbox2/js/lightbox.min',
'animateColors': '../vendor/color-animation/jquery.animate-colors-min',
'videoJs': '../vendor/video.js/dist/video-js/video',
View The Technical Interview Cheat

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
View vimeo.rake
namespace :vimeo do
desc "Get Vimeo HTTP Live Streaming link for private Pro videos"
task :direct => :environment do |t,args|
your_video_id = "66666666" # change this to your video id
loginURL = ""
videoFormAction = "/#{your_video_id}/settings/file"
View muttkQp9Dg
I'm using Kivy in a test project. I'm really enjoying it.
However, the listview is slow.
There is some improvement prevision in listview in future releases?
Thank you
View mistaken_emails
A running tab of mistaken uses of my email address.
8/14/15 - £21.23 of food from Domino's Pizza in Edinburgh, Scotland.
8/25/15 - A receipt for a $10 belt buckle from an Aeropostale store in Chicago.