I hereby claim:
- I am mcls on github.
- I am mcls (https://keybase.io/mcls) on keybase.
- I have a public key whose fingerprint is D608 CAAE 524B 038A 4BB5 BD72 035B 4046 E70B 8644
To claim this, I am signing this object:
| # Make it easier to call rails routes from anywhere | |
| class Routes | |
| include Rails.application.routes.url_helpers | |
| delegate :asset_path, :image_path, to: :controller_helpers | |
| protected | |
| def controller_helpers | |
| ActionController::Base.helpers |
| #!/usr/bin/env bash | |
| # | |
| # Minimimal example: | |
| # | |
| # cors_headers https://www.google.com | |
| # | |
| # Example with origin (-o): | |
| # | |
| # cors_headers -o localhost https://www.google.com | |
| # |
| # file: spec/support/database_cleaner.rb | |
| require 'database_cleaner' | |
| # More info: https://github.com/DatabaseCleaner/database_cleaner | |
| RSpec.configure do |config| | |
| config.before(:suite) do | |
| # Ensure a clean slate | |
| DatabaseCleaner.clean_with(:truncation) | |
| end |
| # Allows you to run rspec with SCREENSHOT=1 to take screenshots. | |
| # The images are stored under tmp/screenshots/ | |
| # | |
| module ScreenshotHelpers | |
| SCREENSHOT_KEY = 'SCREENSHOT' | |
| DIR_PATH = Rails.root.join('tmp', 'screenshots') | |
| # @example | |
| # screenshot("dashboard_clean_slate") | |
| # screenshot("shopping_cart_multiple_items") |
| # file: spec/support/vcr.rb | |
| require 'vcr' | |
| # More info: | |
| # - https://github.com/vcr/vcr | |
| # - https://relishapp.com/vcr/vcr/docs | |
| VCR.configure do |config| | |
| config.cassette_library_dir = File.expand_path(File.join(__dir__, "..", "support", "vcr_cassettes")) |
| # usage: NameGenerator.generate | |
| # | |
| module NameGenerator | |
| def self.generate | |
| [ADVERBS.sample, ADJECTIVES.sample, NAMES.sample].join("_") | |
| end | |
| NAMES = [ | |
| "ai", | |
| "analytics", |
I hereby claim:
To claim this, I am signing this object:
| [alias] | |
| st = status -bs | |
| lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit | |
| b = branch -v | |
| co = checkout | |
| undo = reset --soft HEAD^ | |
| cm = commit -v | |
| today = log --since=midnight --author='Maarten Claes' --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit |
| package main | |
| import ( | |
| "os" | |
| "strings" | |
| "github.com/PuerkitoBio/goquery" | |
| "github.com/codegangsta/cli" | |
| ) | |
| func findSynonyms(query string) string { |
| require 'forwardable' | |
| module RtmpMeta | |
| class Parser | |
| PATTERN = /duration\s+(?<duration>\d+\.?\d+)$/ | |
| attr_reader :raw_data | |
| def initialize raw_data | |
| @raw_data = raw_data | |
| end |