Skip to content

Instantly share code, notes, and snippets.

@imjasonh
imjasonh / markdown.css
Last active Jun 10, 2021
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
View markdown.css
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
View gist:598fa75e22bdfa44cf47

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@andremedeiros
andremedeiros / talks.md
Last active Aug 29, 2015
Baruco 2014 talks
View talks.md

Baruco 2014 talks

Please see the Hackpad where we can all contribute!

@tiegz
tiegz / object_profiler.rb
Last active Aug 29, 2015
Object Profiler for ruby 2.1.0+
View object_profiler.rb
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
@knyar
knyar / statsd.lua
Created Feb 9, 2014
statsd interface for nginx (via ngx_lua)
View statsd.lua
-- ----------------------------------------------------------------------------
-- 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 {
@hubert3
hubert3 / samsung_hash_crack.py
Last active Dec 15, 2016
Python implementation of passcode hashing algorithm used on the Samsung Galaxy S4 GT-I9505 4.2.2
View samsung_hash_crack.py
#!/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
View gist:8393897
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.
@chengyin
chengyin / linkedout.js
Last active Oct 2, 2020
Unsubscribe all LinkedIn email in "one click". For an easier to use version, you can check out the bookmarklet: http://chengyin.github.io/linkedin-unsubscribed/
View linkedout.js
// 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/
@sxua
sxua / UIAppearance.md
Created Sep 18, 2013
UIAppearance methods (including iOS 7)
View UIAppearance.md

UIActivityIndicatorView

5.0

@property (readwrite, nonatomic, retain) UIColor *color

UIBarButtonItem

@aienn
aienn / bydloscript.rb
Created Mar 11, 2013
CMeLLIHa9l_KupuJIJIuLLa_no3BoHuT!
View bydloscript.rb
#usage ruby bydloscript.rb Здесь смешные надписи кириллицей лол!
source = ARGV.join(" ").strip.split(//)
table = { "а" => "a", "А" => "A",
"б" => "6", "Б" => "6",
"в" => "B", "В" => "B",
"г" => "r", "Г" => "r",
"д" => "D", "Д" => "D",
"е" => "e", "Е" => "E",
"ё" => "e", "Ё" => "E",