Skip to content

Instantly share code, notes, and snippets.

View slawosz's full-sized avatar

Sławosz Sławiński slawosz

View GitHub Profile
@slawosz
slawosz / 0_reuse_code.js
Created August 1, 2016 11:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@slawosz
slawosz / sshd.go
Last active August 29, 2015 14:27 — forked from jpillora/sshd.go
Go 1.3 SSH server complete example
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
@slawosz
slawosz / 0-readme.md
Created November 26, 2012 16:49 — forked from sxua/0-readme.md
ruby-1.9.3-p286 cumulative performance patch.

Patch for ruby 1.9.3-p327 is here: https://gist.github.com/4063779

Patched ruby 1.9.3-p286 for 30% faster rails boot

Overview

This script installs a patched version of ruby 1.9.3-p286 with boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Many thanks to funny-falcon for the performance patches.

@slawosz
slawosz / 0-readme.md
Created February 1, 2012 07:49 — forked from burke/0-readme.md
ruby-1.9.3-p0 cumulative performance patch.

Patched ruby 1.9.3-p0 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p0 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84).

Huge thanks to funny-falcon for the performance patches.

@slawosz
slawosz / application.js.coffee
Created December 17, 2011 16:59 — forked from ddemaree/application.js.coffee
Simple Google Maps API v3 integration in CoffeeScript, with non-JS Static Maps fallback
#= require jquery
#= require jquery_ujs
#= require lib/modernizr
#= require lib/jquery.lettering
#= require_tree .
$ ->
$('*[data-googlemap]').googleMap()
true
@slawosz
slawosz / test.rb
Created October 15, 2011 21:13 — forked from paneq/test.rb
Which version do you prefere?
require 'test/unit'
class KeyTest < Test::Unit::TestCase
def test_key
object = Object.new
assert_equal(:submit, object_key(object))
def object.persisted?; true end
assert_equal(:update, object_key(object))
@slawosz
slawosz / shared_connection.rb
Created June 21, 2011 11:18 — forked from josevalim/shared_connection.rb
share connection for selenium driver
# In your test_helper.rb
class ActiveRecord::Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || retrieve_connection
end
end
@slawosz
slawosz / symbol_expressions.rb
Created May 25, 2011 11:36 — forked from pjb3/symbol_expressions.rb
Symbol Expressions Simplified
class Symbol
def |(*args)
@args = args
self
end
def to_proc
Proc.new { |obj|
obj.send *[self] + (@args || [])
}
@slawosz
slawosz / gist:840677
Created February 23, 2011 16:39 — forked from rkh/gist:791974