Please see the Hackpad where we can all contribute!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ObjectSpace | |
def self.profile(&blk) | |
require 'objspace' | |
enable_gc = GC.disable | |
ObjectSpace.trace_object_allocations(&blk) | |
objs = Hash.new(0) | |
ObjectSpace.each_object { |o| | |
if (file = ObjectSpace.allocation_sourcefile(o)) && (line = ObjectSpace.allocation_sourceline(o)) | |
objs["#{file}:#{line}:#{o.class.name}"] += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#usage ruby bydloscript.rb Здесь смешные надписи кириллицей лол! | |
source = ARGV.join(" ").strip.split(//) | |
table = { "а" => "a", "А" => "A", | |
"б" => "6", "Б" => "6", | |
"в" => "B", "В" => "B", | |
"г" => "r", "Г" => "r", | |
"д" => "D", "Д" => "D", | |
"е" => "e", "Е" => "E", | |
"ё" => "e", "Ё" => "E", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ---------------------------------------------------------------------------- | |
-- statsd interface for nginx | |
-- (c) 2014 Anton Tolchanov | |
-- https://gist.github.com/knyar/8905045 | |
-- | |
-- Usage: | |
-- 1. install nginx with ngx_lua; | |
-- 2. put this file as statsd.lua somewhere (/var/lib/nginx/lua/ will do); | |
-- 3. initialize stats in init_by_lua: | |
-- http { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ruby 2.1.0 in Production: known bugs and patches | |
Last week, we upgraded the github.com rails app to ruby 2.1.0 in production. | |
While testing the new build for rollout, we ran into a number of bugs. Most of | |
these have been fixed on trunk already, but I've documented them below to help | |
anyone else who might be testing ruby 2.1 in production. | |
@naruse I think we should backport these patches to the ruby_2_1 branch and | |
release 2.1.1 sooner rather than later, as some of the bugs are quite critical. | |
I'm happy to offer any assistance I can to expedite this process. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Go to page https://www.linkedin.com/settings/email-frequency | |
// 2. You may need to login | |
// 3. Open JS console | |
// ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers)) | |
// 4. Copy the following code in and execute | |
// 5. No more emails | |
// | |
// Bookmarklet version: | |
// http://chengyin.github.io/linkedin-unsubscribed/ |
To toast:
- Make sure you have ImageMagick installed (
brew install imagemagick
) - Change line 7 of toast.rb to the repository name you're working with
- toast!
$ bundle install
$ ./get_token [user] [pass]
$ export GHUSER=[myuser]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
''' | |
Python implementation of passcode hashing algorithm used on the Samsung Galaxy S4 GT-I9505 4.2.2 | |
Correct PIN for hash and salt below is 1234. | |
Get 40-character hash value in ascii hex format from file /data/system/password.key on the phone | |
Get salt in signed numeric format by doing sqlite3 query SELECT value FROM locksettings WHERE name = 'lockscreen.password_salt' on /data/system/locksettings.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
font-size: 12pt; | |
font-family: monospace; | |
font-weight: normal; | |
font-style: normal; | |
text-decoration: none; | |
color: black; | |
cursor: default; | |
} |
OlderNewer