The first file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'mechanize' | |
require 'json' | |
url = "https://en.wikipedia.org/wiki/List_of_city_nicknames_in_the_United_States" | |
STATES = ["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", | |
"Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", | |
"Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", | |
"Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__________.__ | |
\______ \__|____________________ | |
| ___/ \___ /\___ /\__ \ | |
| | | |/ / / / / __ \_ | |
|____| |__/_____ \/_____ \(____ / | |
\/ \/ \/ | |
__________ | |
\______ \ | |
| ___/ | |
| | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here is some text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
engines: | |
csslint: | |
enabled: true | |
duplication: | |
enabled: false | |
config: | |
languages: | |
- ruby | |
- javascript | |
- python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IngredientsController < ApplicationController | |
def index | |
@ingredients = if params[:term] | |
Ingredient.where("name LIKE ?", "%#{params[:term]}%") | |
else | |
Ingredient.all.ordered | |
end | |
respond_to do |format| | |
format.html | |
format.json { render json: @ingredients, root: false } |
I hereby claim:
- I am andrewbredow on github.
- I am andrewbredow (https://keybase.io/andrewbredow) on keybase.
- I have a public key ASAHE6wibDfIb55Fmu8qeDe9qIU-V7goqJUSBPTks9OFwwo
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
module Kernel | |
define_method "√" do |number| | |
Math.sqrt(number) | |
end | |
end | |
# Then call: | |
# √ 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This works | |
array_map(function($key, $value) { | |
var_dump($key); | |
var_dump($value); | |
}, array_keys($someArray), $someArray); |