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
history|grep git|awk '{print $2 " " $3}'|sort|uniq -c|sort -nr|head |
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
var http = require('http'); | |
http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end("Não tem que ser dificil!\n"); | |
}).listen(1337, "127.0.0.1"); |
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
//VIEW THE ORIGINAL IN: HTTP://via7solucoes.com.br/curriculos/cadastro.asp | |
if (document.getElementById("cpff").value != "") { | |
if ("024.683.681-42|922.480.201-04|041.478.491-05|023.783.799-43|981.918.021-04|027.457.339-31|011.672.181-24|002.103.331-54|062.806.499-38|025.818.191-54|859.227.301-34|032.044.441-47|889.651.631-53|041.383.129-94|203.379.149-15|011.356.831-23|001.735.480-32|046.078.089-11|032.963.821-19|000.200.191-81|892.546.431-49|708.577.921-72|007.426.349-81|013.019.741-61|014.861.641-02|924.510.809-06|396.296.431-20|029.623.411-79|600.809.221-04|035.036.771-00|761.546.531-15|408.995.359-68|007.290.370-88|848.703.891-34|009.376.861-31|950.705.401-49|024.313.891-11|040.704.951-77|880.506.021-68|651.733.761-04|024.710.931-24|058.720.126-67|006.154.761-12|283.730.318-63|423.054.629-72|033.293.281-85|967.446.851-04|029.033.781-00|372.529.091-15|036.206.831-31|019.258.291-70|020.193.161-37|993.860.621-00|014.472.001-95|022.062.551-46|066.174.159-14|996.782.091-87|003.892.131-60|029.764.421-18|731.9 |
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
$ export DB=my_wpdb | |
$ export USER=dbuser | |
$ export PASS=dbpass | |
$ ruby -r './_import/wordpress.rb' -e 'Jekyll::WordPress.process("#{ENV["DB"]}", "#{ENV["USER"]}", "#{ENV["PASS"]}")' |
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
ls -l | wc -l |
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
Dir.foreach("../_posts/") do |file| | |
p "started #{file}" | |
begin | |
content = File.read("../_posts/#{file}") | |
images_found = content.scan /http\S*\.jpg|gif|png/i | |
images_found.each do |img| | |
system "curl #{img} -O" | |
p "image saved: #{img}" |
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
ruby-1.9.2-p180 :002 > t = "Por quais motivos?Abraços,Vinicius Quaiato." | |
=> "Por quais motivos?Abraços,Vinicius Quaiato." | |
ruby-1.9.2-p180 :003 > t.gsub /(\.|\?|\!)(Abraços|Att),/, ".\n\n#{$2},\n" | |
=> "Por quais motivos.\n\n,\nVinicius Quaiato." | |
ruby-1.9.2-p180 :004 > t.gsub /(\.|\?|\!)(Abraços|Att),/, ".\n\n#{$2},\n" | |
=> "Por quais motivos.\n\nAbraços,\nVinicius Quaiato." |
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 | |
Dir.foreach("./") do |file| | |
begin | |
p "started #{file}" | |
content = File.read(file) | |
#quebra de linha para headings | |
replace = content.gsub /###/, "\n\n###" | |
replace = content.gsub /##/, "\n\n##" |
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
%w(rubygems sequel fileutils yaml active_support/inflector).each{|g| require g} | |
require File.join(File.dirname(__FILE__), "downmark_it.rb") | |
module Jekyll | |
module WordPress | |
def self.process(dbname = 'SEU_DB_NAME', user = 'SEU_DB_USER', pass = 'SEU_DB_PASS', host = 'localhost', table_prefix = 'wp_') | |
db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host, :encoding => 'utf8') | |
%w(_posts _drafts images/posts/featured).each{|folder| FileUtils.mkdir_p folder} |
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 Foo | |
@bar | |
def initialize(bar) | |
@bar = bar | |
end | |
def are_equal?(foo) | |
b = foo.instance_variable_get :@bar | |
b == @bar | |
end | |
end |