Skip to content

Instantly share code, notes, and snippets.

@rauchg
rauchg / README.md
Last active Feb 19, 2021
require-from-twitter
View README.md
@adrienjoly
adrienjoly / startup-noob-guide.md
Last active Jun 26, 2021
Startup Noob Guide: Tips and resources on how to test, develop your startup idea, or find a developer/associate/CTO
View startup-noob-guide.md

Startup Noob Guide (bit.ly/startupnoob)

If you want to create a startup, and you've never done that before, you should consult the resources that are relevant to your situation.

[FR] Si vous comprenez le français, je vous invite à regarder la vidéo de mon pote Shubham qui résume assez bien le plus gros des conseils de cette page, en 8 minutes: Vous avez une idée de startup ?.

[FR] ...et si vous voulez comprendre tout ce contenu de manière plus efficace et ludique, inscrivez-vous sur mon MOOC "Startup Tour: créez votre startup en 3h" (gratuit).


@bloodyowl
bloodyowl / gist:5d8adcf50e890ebafb95
Last active Nov 21, 2019
ES6 tl;dr; for beginners
View gist:5d8adcf50e890ebafb95
// ES6 tl;dr; for beginners
// 1. variables
// `const` & `let` are scoped at the block level
if(true) {
let foo = "bar"
}
foo // ReferenceError
View gist:ba0edffa516e6c8323f7
(Benoit Benezech 2014-10-27 16:17:33 +0100 177) it "returns the availability and correct prices" do
(Benoit Benezech 2014-10-27 16:17:33 +0100 178) get :extension_availability, id: @rental.id, format: :json, end_date: (@rental.ends_at + 3.days).strftime("%d/%m/%Y"), end_time: "am", distance: '10'
(Valentin Rabanelly 2013-06-03 15:51:01 +0200 179) parsed_body = JSON.parse(response.body)
(Michael Bensoussan 2014-06-23 11:11:51 +0200 180) expect(parsed_body["availability"]["available"]).to be true
(Marc G Gauthier 2013-09-23 12:38:14 +0200 181) expected_message = t("cars.availability.messages.#{status.info}")
(Alexandru Keszeg 2013-07-31 18:40:46 +0300 182) expect(parsed_body["availability"]["message"]).to eq(expected_message)
(Benoit Benezech 2014-10-27 16:17:33 +0100 183) expect(parsed_body["charges"]["rental_price"]["total"]).to eq(61.1)
(Nicolas Mondollot 2013-06-09 16:34:56 +0200 184) end
View mysql_index_madness.rb
require 'benchmark'
ActiveRecord::Base.logger = nil
ActiveRecord::Schema.verbose = false
ActiveRecord::Migration.verbose = false
# PARAMS
sql = ""
attributes = []
@marcgg
marcgg / gist:2e57218351e27fcc20c4
Last active Apr 7, 2018
Mapping of country codes with international phone number prefixes, in JSON!
View gist:2e57218351e27fcc20c4
{
"AF": "93",
"AL": "355",
"DZ": "213",
"AD": "376",
"AO": "244",
"AQ": "672",
"AR": "54",
"AM": "374",
"AW": "297",
@weppos
weppos / fliwn.rb
Created Dec 6, 2012
Script to download a Flickr photoset.
View fliwn.rb
#!/usr/bin/env ruby -wKU
require 'rubygems'
require 'flickraw'
require 'open-uri'
require 'fileutils'
FlickRaw.api_key = "YOUR_API_KEY"
FlickRaw.shared_secret = "YOUR_SHARED_SECRET"
@matisojka
matisojka / measure_gem_loading_time.rb
Created Jul 4, 2012
Measure Gem loading time in your Rails APP
View measure_gem_loading_time.rb
# Disclaimer: this solution has been taken from the post: http://stackoverflow.com/a/5071198/784270
# navigate to the bundler gem and in lib/bundler/runtime.rb,
# find the line that does Kernel.require and wrap it like this
puts Benchmark.measure("require #{file}") {
Kernel.require file
}.format("%n: %t %r")
# Add
@chsh
chsh / app_delegate.rb
Created May 7, 2012
Example to use UIWebView for RubyMotion.
View app_delegate.rb
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
@window = UIWindow.alloc.initWithFrame UIScreen.mainScreen.bounds
@window.rootViewController = GoogleViewController.alloc.init
@window.makeKeyAndVisible
true
end
end
@panthomakos
panthomakos / benchmark.rb
Created May 3, 2012
Benchmark Your Bundle
View benchmark.rb
#!/usr/bin/env ruby
require 'benchmark'
REGEXPS = [
/^no such file to load -- (.+)$/i,
/^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i,
/^Missing API definition file in (.+)$/i,
/^cannot load such file -- (.+)$/i,
]