Skip to content

Instantly share code, notes, and snippets.

@ahoward
ahoward / proc-gt-module.rb
Created November 29, 2011 22:28
proc > module
#! /usr/bin/env ruby
# ClassMethods/InstanceMethods as modules are nice. but procs are mo betta. you can't do any of the following via modules.
#
module M
ClassMethods = proc do
class << self
alias_method 'bar', 'foo'
end
@ku1ik
ku1ik / gist:1694742
Created January 28, 2012 15:44
Install Cyanogenmod7 on HTC Desire S with hboot 2.00.0002

There's no need to make the phone S-OFF (like some people say).

  • Disable fast/quick reboot (Settings » Power » Fastboot)

  • Download fastboot binary

  • Unlock bootloader: http://htcdev.com/bootloader/

    Put the phone in Fastboot USB mode (Turn off, hold Volume Down + Power)

@chetan
chetan / yardoc_cheatsheet.md
Last active May 10, 2024 02:53
YARD cheatsheet
@bokmann
bokmann / ActiveRepository.rb
Created March 27, 2012 16:15
ActiveRepository Strawman
# MOTIVATION: As rails apps are growing, people are noticing the drawbacks
# of the ActiveRecord pattern. Several apps I have seen, and several
# developers I have spoken to are looking towards other patterns for object
# persistence. The major drawback with ActiveRecord is that the notion
# of the domain object is conflated with what it means to store/retrieve
# it in any given format (like sql, json, key/value, etc).
#
# This is an attempt to codify the Repository pattern in a way that would
# feel comfortable to beginner and seasoned Ruby developers alike.
#
@paulmillr
paulmillr / active.md
Last active May 15, 2024 02:25
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user =&gt; user.followers &gt; 1000)
@dkubb
dkubb / git-remove-merged.sh
Last active March 8, 2023 17:24 — forked from schacon/gist:942899
delete all remote branches that have already been merged into master
git remote update &&
git remote prune origin &&
git branch -r --merged origin/master |
awk -F"/" '!/(>|master)/ {print $2}' |
xargs -rL1 git push origin --delete
@solnic
solnic / dm1.txt
Created December 4, 2012 12:57
dm1 vs dm2 - eager loading association
1.9.3p327 :011 > Benchmark.bm { |x| x.report { User.all.each { |u| u.city } } }
user system total real
4.320000 0.010000 4.330000 ( 4.344362)
@mbj
mbj / book.rb
Created December 19, 2012 19:53
RFC: Uncovered mutation example for blog post by @solnic
class Book
attr_reader :sections
def initialize
@sections = []
@index = {}
end
def section(number)
@index.fetch(number) do
module Calculate
attr_accessor :num1
attr_accessor :num2
def calculate
self.!
end
end
class Arithmetic < Module
@kjellski
kjellski / gitorious_resque_debug_doc.md
Created November 28, 2013 13:20
gitorious documentation improvement for resque debugging...

debugging in gitorious

In case you're experiencing any errors or unexpected behaviour, these are stept to follow in order to narrow down the problem. The goal is to get the most out of your system that would help the developers to identify the problem and help you fixing your problem.

is the problem reproducable?

This is the most important question you should be able to answer. If not, it's really hard to help. If it is not happening all the time, more like "every now and then", try to document what happened before, each time something unexpected happens, write it down. Collects all informations arround the event that should succeed, but does not.

Try to answer these questions:

What steps will reproduce the problem?