Skip to content

Instantly share code, notes, and snippets.

Avatar

David Bourguignon dbourguignon

View GitHub Profile
@kule
kule / mini_rspec.rb
Created Sep 11, 2018
Simplified example of how rspec works
View mini_rspec.rb
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'colorize'
end
class MatcherInterface
def initialize(some_object)
@some_object = some_object
View happy_freelancing.md

Happy Freelancing

Je m’appelle Thibaut Assus, j’ai 30 ans, je suis freelance en développement web et ma technologie de prédilection est le Ruby on Rails. J’ai maintenant un peu d’expérience dans le domaine du freelancing et ce document a pour but de partager avec vous une partie de cette expérience.

Mon parcours de développeur Ruby

@albrow
albrow / Rakefile
Last active Dec 10, 2015
An excerpt from the Rakefile I use to deploy my blog. http://blog.alexbrowne.info
View Rakefile
# ...
desc "Deploy website to s3/cloudfront via aws-sdk"
task :s3_cloudfront => [:generate, :minify, :gzip, :compress_images] do
puts "=================================================="
puts " Deploying to Amazon S3 & CloudFront"
puts "=================================================="
# setup the aws_deploy_tools object
config = YAML::load( File.open("_config.yml"))
@adamgit
adamgit / .gitignore
Last active Jun 23, 2022
.gitignore file for Xcode4 / OS X Source projects
View .gitignore
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
@nverinaud
nverinaud / gist:3706079
Created Sep 12, 2012
Git workflow: project with libraries
View gist:3706079
# Add a library
$ git remote add -f lib/[libname] [lib-remote-URL] # Add the lib remote and fetch
$ git read-tree --prefix=lib/[libname]/ -u lib/[libname]/master # Import the library files
$ git commit -m "Add [libname] library." # Commit the added library
$ git push # We're done !
# Update to the latest version of a library
$ git pull -s subtree --squash --no-commit lib/[libname] master # Update files of the library
@mislav
mislav / easy_way.rb
Last active May 20, 2020
RESOLVE SHORT URLS before storing. Short URLs are for microblogging; you should never actually keep them around.
View easy_way.rb
require 'net/http'
# WARNING do not use this; it works but is very limited
def resolve url
res = Net::HTTP.get_response URI(url)
if res.code == '301' then res['location']
else url.to_s
end
end
@yannski
yannski / copy.rb
Created Jul 4, 2012
Copy from one Amazon S3 bucket to another with two different accounts
View copy.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'right_aws'
# it's possible to copy files from one bucket to another, even it the account is not the same
# in that case, the original file should be public
srcBkt = 'XXX'
destBkt = 'YYY'