Skip to content

Instantly share code, notes, and snippets.

View muminoff's full-sized avatar
🏠
Working from home

Sardor Muminov muminoff

🏠
Working from home
  • EA
  • Seoul, Korea
View GitHub Profile
@muminoff
muminoff / README.md
Last active August 29, 2015 14:06 — forked from bergie/README.md

This is an example of using a Collection view with Backbone.

#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'

Serving Django and Twisted using HAproxy

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

Getting back my productivity

Effectiveness is doing the right things.
Efficiency is doing things right.

Effectiveness

  • three outcomes for the day

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

1. Install Linux updates, set time zones, followed by GCC and Make
sudo yum -y update
sudo ln -sf /usr/share/zoneinfo/America/Indianapolis \
/etc/localtime
sudo yum -y install gcc make
2. Download, Untar and Make Redis 2.8 (check here http://redis.io/download)
@muminoff
muminoff / es_index.js
Last active August 29, 2015 14:13
Elasticsearch javascript example
var jsBody = {},
i,
arr_1 = [row1, row2, row3, row4];
arr_2 = [field1, field2, field3, field4];
for (i = 0; i < arr_1.length; i++) {
jsBody[arr_1[i]] = arr_2[i];
}
client.index(
[
"Automotive",
"Budgeting",
"HVAC",
"Heaters",
"Hydraulics",
"Logistics Management",
"Management",
"Negotiation",
"Project Planning",
docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY -v /dev/snd:/dev/snd --privileged --name tor-browser jess/tor-browser
### Install OpenJDK
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Download and Install ElasticSearch
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.1.deb
sudo dpkg -i elasticsearch-1.3.1.deb