Skip to content

Instantly share code, notes, and snippets.

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

Leonid Bugaev buger

🏠
Working from home
View GitHub Profile
@buger
buger / gist:1345486
Created November 7, 2011 16:49
ΠœΠΎΠ½Ρ‚Π΅ΠΊΠ°Ρ€Π»ΠΎ ΠΌΠ΅Ρ‚ΠΎΠ΄ΠΎΠΌ ΠΏΠ»ΠΎΡ‰Π°Π΄Π΅ΠΉ
function q2 =pl(a,b,N)
// Высота Π³Ρ€Π°Ρ„ΠΈΠΊΠ°
G=4;
q2 = zeros(1,10);
for i=1:10
// ΠšΠΎΠ»ΠΈΡ‡Π΅ΡΡ‚Π²ΠΎ Ρ‚ΠΎΡ‡Π΅ΠΊ ΠΏΠΎΠΏΠ°Π²ΡˆΠΈΡ… ΠΏΠΎΠ΄ Π³Ρ€Π°Ρ„ΠΈΠΊ
@buger
buger / gist:1687945
Created January 27, 2012 09:25
Matching js
  if top is window
    bindReady =>
      @client  = new ClientInfo

should become

 if top is window
@buger
buger / gist:1907352
Created February 25, 2012 08:36
Handling server maintenance
https://granify.acunote.com/projects/29417/tasks/516
[21:44:58][Boxes] SOCKET Node ["click", "1"]
[21:44:58][Boxes] >> Node
[21:44:58][Boxes] >> 2
[21:44:58][Boxes] >> 5
[21:44:58][Boxes] >> click
[21:44:58][Boxes] >> 1
[21:44:58][Boxes] >> 1
[21:44:58][Boxes] << ok
[21:44:58][Boxes] << 0
[21:44:58][Boxes] <<
require 'rubygems'
require 'capybara'
require 'capybara/dsl'
require 'capybara/webkit'
body = "<html>
<body>
<div id='div_example'></div>
<iframe id='iframe_example'></iframe>
</body>
require 'benchmark'
require 'mongo'
r = Random.new
$db = Mongo::Connection.new.db("test")
def create_collection site_id
coll = $db["rules_#{site_id}"]
coll.drop()
@buger
buger / gist:2072746
Created March 18, 2012 13:42
Mongo benchmark
require 'benchmark'
require 'mongo'
r = Random.new
$db = Mongo::Connection.new.db("test")
def create_collection site_id
coll = $db["rules_#{site_id}"]
coll.drop()
@buger
buger / gist:2072760
Created March 18, 2012 13:42
Ruby + Redis benchmark
require 'benchmark'
#require 'unprof'
require "redis"
require 'bson' # Using bson to speedup decoding
r = Random.new
$db = Redis.new
=begin
@buger
buger / gist:2075741
Created March 18, 2012 15:47
asdasd

Teasdasd asdasd asdsad

** asdasdasd

@buger
buger / dabblet.css
Created April 3, 2012 13:15
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;