Skip to content
View TicTacToe.py
# Recurse Center Interview #2
# Feb 2016
# Michelle Ye
class Board():
def __init__(self):
self.values = ['[ ]'] * 9
self.symbol_map = {0: 'x', 1: 'o'}
View migration
$ rake db:migrate
View simple_flexbox_check.js
const doc = document.body || document.documentElement;
const style = doc.style;
if ( style.webkitFlexWrap == '' || style.msFlexWrap == '' || style.flexWrap == '' ) {
doc.className += " supports-flex";
}
View thunar-openssl-encrypt.sh
#!/bin/sh
usage() {
echo "$0 -f <filename>"
echo
echo " required:"
echo " -f input filename"
echo
}
View di-fm-premium-account-generator.sh
#!/bin/bash
AGENT="AudioAddict-di/1.4.7 iOS/8.1"
COOKIES="./cookies.txt"
AUTH="ephemeron:dayeiph0ne@pp"
DOMAIN=gmail.com
PLAYLISTDI="di.fm.m3u"
PLAYLISTSKY="sky.fm.m3u"
PLAYLISTJAZZ="jazzradio.m3u"
PLAYLISTROCK="rockradio.m3u"
JSONDI="http://listen.di.fm/premium_high.json"
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View laravel-server-commands.sh
sudo apt-get install python-software-properties
sudo apt-get update
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0 php7.0-mysql php7.0-fpm nginx
sudo apt-get install php7.0-gd php7.0-curl php7.0-mcrypt php7.0-sqlite3 php7.0-json
sudo phpenmod mcrypt
sudo phpenmod gd
View WebDriverListener.java
package testing.readdle.framework;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.testng.*;
import org.testng.annotations.ITestAnnotation;
import ru.yandex.qatools.allure.Allure;
import ru.yandex.qatools.allure.annotations.Attachment;
import ru.yandex.qatools.allure.annotations.Step;
View latency.markdown

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns  = 250 µs
View feed-html-link
Something went wrong with that request. Please try again.