Skip to content

Instantly share code, notes, and snippets.

View codematix's full-sized avatar

Ranganath Kini codematix

View GitHub Profile
{
"caret_style": "solid",
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme",
"enable_tab_scrolling": false,
"file_exclude_patterns":
[
"*.pyc",
"*.pyo",
"*.exe",
"*.dll",
@codematix
codematix / latency.txt
Created August 7, 2014 11:31 — forked from jboner/latency.txt
Latency Comparison Numbers
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms

Hey! I saw this has been indexed by the search engines. It is a first draft of a post I ended up publishing on my blog at: Scaling PostgreSQL With Pgpool and PgBouncer

Thanks for stopping by!

PostgreSQL and Pgpool Architecture

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@codematix
codematix / url-regex.md
Last active August 29, 2015 14:22
Regular Expressions to match URL components

Documentation

  1. Scheme - The scheme name consists of a sequence of characters beginning with a letter and followed by any combination of letters, digits, +, ., or -. Although schemes are case-insensitive, the canonical form is lowercase and documents that specify schemes must do so with lowercase letters. The scheme name is followed by a colon :.
  2. Host Name - Hostname labels may contain only the ASCII letters a through z (in a case-insensitive manner), the digits 0 through 9, and the -. While a hostname may not contain other characters, such as the underscore character _, other DNS names may contain the underscore.
  3. Port Number - A port number is a 16-bit unsigned integer, thus ranging from 0 to 65535.
  4. Path - If present, may optionally begin with a single forward slash /. It may not begin with two slash characters //. The path is a sequence of segments (conceptually similar to directories, though not necessarily representing them) separated by a forward s

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@codematix
codematix / how-to-set-up-stress-free-ssl-on-os-x.md
Last active September 10, 2015 17:36 — forked from jed/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@codematix
codematix / buddyLists.jsx
Created September 16, 2015 17:05
Linked Dropdowns Approach 1
var _ = require('underscore'),
React = require('react/addons');
var LookupStore = global.dispatcher.getStore('LookupStore');
var MyComponent = React.createClass({
displayName: 'MyComponent',
getInitialState: function() {
return {
@codematix
codematix / webpack.config.js
Created September 17, 2015 17:49
Two Explicit Vendor Chunks
var path = require("path");
var CommonsChunkPlugin = require("../../lib/optimize/CommonsChunkPlugin");
module.exports = {
entry: {
vendor1: ["./vendor1"],
vendor2: ["./vendor2"],
pageA: "./pageA",
pageB: "./pageB",
pageC: "./pageC"
},
@codematix
codematix / development-env.sh
Last active March 7, 2016 16:28
Install Golang
sudo apt-get update
sudo apt-get install build-essential curl vim git mercurial bison
# install gvm
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
# install Go
gvm install go1.4
gvm use go1.4
gvm install go1.5