Skip to content

Instantly share code, notes, and snippets.

View tsyber1an's full-sized avatar
🎯
Focusing

Tsyren O. tsyber1an

🎯
Focusing
View GitHub Profile
@tsyber1an
tsyber1an / gist:2936374
Created June 15, 2012 13:01
git completion
#!bash
#
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
@tsyber1an
tsyber1an / index.html
Created June 29, 2012 15:29
nvd3 tooltip tests
<!DOCTYPE>
<html>
<head>
<meta charset="utf-8">
<link href="http://github.com/novus/nvd3/raw/master/src/d3.css" rel="stylesheet" type="text/css"/>
<style>
body {
@tsyber1an
tsyber1an / gist:3047383
Created July 4, 2012 13:37
cake with minify and coffee watcher
fs = require 'fs'
{print} = require 'sys'
{exec} = require 'child_process'
{spawn} = require 'child_process'
option '-o', '--output [DIR]', 'output dir'
task 'minify', 'Minify mongo production scripts', ->
exec 'uglifyjs --overwrite lib/mongo/lib/*.js', (err, stdout, stderr) ->
@tsyber1an
tsyber1an / gist:3052150
Created July 5, 2012 07:53
sum of elems in array
total = 0
$.each arr, ->
total += this
total
@tsyber1an
tsyber1an / index.html
Created July 5, 2012 10:10
nvd3 example
#stats{style: "height: 500px;"}
%svg

Don't use MongoDB

I've kept quiet for awhile for various political reasons, but I now feel a kind of social responsibility to deter people from banking their business on MongoDB.

Our team did serious load on MongoDB on a large (10s of millions of users, high profile company) userbase, expecting, from early good experiences, that the long-term scalability benefits touted by 10gen

@tsyber1an
tsyber1an / xml_helper.rb
Created November 28, 2012 06:00
xml helper
module Alfabank
module XmlHelper
class <<self
def tag(name, value, attribues = {})
attrs = attribues.map{|n, v| "#{n}=\"#{v}\""}.join(' ')
"<#{name} #{attrs}>#{value}</#{name}>"
end
end
end
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
@tsyber1an
tsyber1an / README.md
Created February 20, 2013 11:44 — forked from mbostock/.block

This variation of a simple bar chart adds sorting with staggered delay and translucency to improve readability during the transition. This technique is recommended by Heer & Robertson. Use the checkbox in the top right to turn sorting on or off.

@tsyber1an
tsyber1an / gist:5046400
Created February 27, 2013 08:48
some sort of examples 'how to use threads
require 'thread'
require 'net/http'
urls = ["http://slonweb.ru", "https://github.com", "http://www.ruby-doc.org/core-2.0/Thread.html"]
threads = []
responses = []
responses_mutex = Mutex.new
urls.each do |url|