##Refs
Add to Gemfile: gem 'wicked_pdf'
#!/usr/bin/env ruby | |
require "thor" | |
class MyCLI < Thor | |
desc "download", "production database" | |
def download(remote) | |
puts "Downloading... #{remote}" | |
system "heroku pgbackups:capture --expire --remote #{remote}" | |
system "curl `heroku pgbackups:url --remote #{remote}` -o #{remote}.dump" | |
puts "Done!" |
package main | |
import ( | |
"code.google.com/p/go-tour/wc" | |
"strings" | |
) | |
func WordCount(s string) map[string]int { | |
m := make(map[string]int) | |
words := strings.Fields(s) |
@font-face { | |
font-family: "GaroaBold"; | |
src: url(/assets/garoaminuscula.eot); | |
src: local("GaroaBold"), | |
url(/assets/garoaminuscula.eot?#iefix) format("embedded-opentype"), | |
url(/assets/garoaminuscula.woff) format("woff"), | |
url(/assets/garoaminuscula.ttf) format("truetype"), | |
url(/assets/garoaminuscula.svg#GaroaBold) format("svg"); | |
font-weight: normal; | |
font-style: normal; |
##Refs
Add to Gemfile: gem 'wicked_pdf'
CREATE DATABASE "db" with ENCODING = 'unicode' lc_collate='pt_BR.UTF-8' lc_ctype='pt_BR.UTF-8' TEMPLATE=template0; | |
show lc_collate; | |
select * from (values('Éder', 'Eda', 'Edu')) x order by 1; | |
require 'rubygems' | |
require 'mini_magick' | |
color = '#103afc' | |
img = MiniMagick::Image.open("letter_x.png") | |
img.combine_options do |c| | |
c.add_command( 'level-colors') | |
c.+ "#{color}," |
CREATE FUNCTION distance (latA double, lonA double, latB double, LonB double) | |
RETURNS double DETERMINISTIC | |
RETURN 2 * ASIN(SQRT((SIN((radians(latA) - radians(latB))/2) * SIN((radians(latA) - radians(latB))/2) + | |
COS(radians(latA)) * COS(radians(latB)) * SIN((radians(lonA) - radians(LonB))/2)*SIN((radians(lonA) - radians(LonB))/2)))) * 6371.01 |
def create | |
erros = [] | |
variants = [] | |
ProductionLabel.transaction do | |
begin | |
label = ProductionLabel.create!(params[:production_labels]) | |
unless (label.valid?) | |
raise label.errors.full_messages | |
end | |
/*ok | |
/** | |
* The first commented line is your dabkjkjblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height:100%; |
[branch] | |
autosetuprebase = always |