This file contains hidden or 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
| --- | |
| - :cod_uf: '52' | |
| :uf: Goiás | |
| :city_id: '00050' | |
| :city: Abadia de Goiás | |
| :sigla_uf: GO | |
| :city_code: '5200050' | |
| - :cod_uf: '31' | |
| :uf: Minas Gerais | |
| :city_id: '00104' |
This file contains hidden or 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
| // clone this gist to a empty folder, the run: | |
| // npm init (and follow steps) | |
| // npm install express --save | |
| // npm install swig --save | |
| // node app.js and open http://localhost:3000 | |
| function App() { | |
| var express = require('express'); |
This file contains hidden or 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
| <?php | |
| $a = 'Neto'; | |
| echo $a; |
This file contains hidden or 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
| require "active_record" | |
| namespace :db do | |
| db_config = YAML::load(File.open('config/database.yml')) | |
| db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'}) | |
| desc "Create the database" | |
| task :create do | |
| ActiveRecord::Base.establish_connection(db_config_admin) |
Today, in Ruby, if I want to make a network request, I block
response = Net::HTTP.get("/post/1")If I want to do multiple requests in parallel, I can use a thread per request
responses = ["/post/1", "/post/2"].map do |url|Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
This file contains hidden or 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
| /*Pixel straps start here*/ | |
| /*Scroll hard for % straps*/ | |
| .0{ width: 0px;} | |
| .1{ width: 1px;} | |
| .2{ width: 2px;} | |
| .3{ width: 3px;} | |
| .4{ width: 4px;} | |
| .5{ width: 5px;} | |
| .6{ width: 6px;} |
This file contains hidden or 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
| /* | |
| * A simple way to format numbers as human readable strings. | |
| * E.g., 123456789 ==> 123 million | |
| * | |
| * Written by Christian Stigen Larsen | |
| * http://csl.sublevel3.org | |
| * | |
| * Placed in the public domain by the author, 2012 | |
| */ |
NewerOlder