Skip to content

Instantly share code, notes, and snippets.

View vmarquet's full-sized avatar

Vincent Marquet vmarquet

View GitHub Profile
@jordelver
jordelver / gist:4352220
Created December 21, 2012 11:18
Move a deprecated gem into vendor/gems

Move a deprecated gem into vendor/gems

If a gem gets pulled from rubygems.org, but you still have it locally (or can get hold of it somehow), you can move the gem into your vendor/gems directory.

Unpack the gem into vendor/gems

gem unpack <gem-name> --target vendor/gems

Edit the Gemfile to match

@ndarville
ndarville / business-models.md
Last active February 27, 2025 10:00
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@klange
klange / _.md
Last active December 23, 2024 14:40
It's a résumé, as a readable and compilable C source file. Since Hacker News got here, this has been updated to be most of my actual résumé. This isn't a serious document, just a concept to annoy people who talk about recruiting and the formats they accept résumés in. It's also relatively representative of my coding style.

Since this is on Hacker News and reddit...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later). My actual résumé is a good bit crazier.
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • Since people kept complaining, I've fixed the assignments of string literals to non-const char *s.
  • My use of type * name, however, is entirely intentional.
  • If you're using an older compiler, you might have trouble with the anonymous unions and the designated initializers - I think gcc 4.4 requires some extra braces to get them working together. Anything reasonably recent should work fine. Clang and gcc (newer than 4.4, at le
@gpfeiffer
gpfeiffer / extended_gcd.rb
Last active January 29, 2022 14:16
Extended Euclidean Algorithm in Ruby
#############################################################################
##
## extended_gcd.rb
##
## given non-negative integers a > b, compute
## coefficients s, t such that gcd(a, b) == s*a + t*b
##
def extended_gcd(a, b)
# trivial case first: gcd(a, 0) == 1*a + 0*0
@sartak
sartak / a.md
Last active June 26, 2024 04:59
Anki 2 annotated schema
@rickenharp
rickenharp / env.rb
Created September 24, 2012 08:05
Setting the locale in capybara with selenium-webdriver
Capybara.register_driver :selenium_de do |app|
require 'selenium/webdriver'
profile = Selenium::WebDriver::Firefox::Profile.new
profile['intl.accept_languages'] = "de"
Capybara::Selenium::Driver.new(app, :profile => profile)
end
Capybara.javascript_driver = :selenium_de
@mloberg
mloberg / gist:3750653
Created September 19, 2012 16:35
Find file in git based on md5 checksum.
#!/bin/sh
CHECKSUM=$1
FILE=$2
if [[ -z "$CHECKSUM" ]]; then
echo "Usage: $0 md5 file"
exit 1
elif [[ -z "$FILE" ]]; then
echo "Usage: $0 md5 file"
@JoshuaEstes
JoshuaEstes / 000-Cheat-Sheets.md
Last active April 3, 2025 19:12
Developer Cheat Sheets for bash, git, gpg, irssi, mutt, tmux, and vim. See my dotfiles repository for extra info.
@bradland
bradland / Rakefile
Created March 1, 2012 21:21
Rake default lists tasks
desc "The default task; lists tasks"
task :default do
puts `rake --tasks`
end
desc "Go ahead, you deserve it"
task :endulge do
puts "You're great. You really are."
end
@bcse
bcse / scrdec18-VC8.exe
Created February 15, 2012 10:13
Windows Script Decoder 1.8 (Decoding JScript.Encoded)