import code; code.interact(local=locals())IPython with embed()
| --- | |
| - :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' |
| // 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'); |
| <?php | |
| $a = 'Neto'; | |
| echo $a; |
| 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|| # This is a skeleton for testing models including examples of validations, callbacks, | |
| # scopes, instance & class methods, associations, and more. | |
| # Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
| # | |
| # I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
| # so if you have any, please share! | |
| # | |
| # This skeleton also assumes you're using the following gems: | |
| # | |
| # rspec-rails: https://github.com/rspec/rspec-rails |
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| /*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;} |
| /* | |
| * 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 | |
| */ |