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
| #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 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
| 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 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
| 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 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
| ls -l | wc -l |
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
| $ 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 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
| //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 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
| 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 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
| history|grep git|awk '{print $2 " " $3}'|sort|uniq -c|sort -nr|head |
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
| #copy the gist(https://gist.github.com/2550777) to the path below | |
| if [ -f /usr/local/git/contrib/completion/git-completion.bash ]; then | |
| . /usr/local/git/contrib/completion/git-completion.bash | |
| fi | |
| GIT_PS1_SHOWDIRTYSTATE=true | |
| #to show the full directory eg.: "~/Projects/foo_project" | |
| PS1='\[\033[32m\]\u \033[01;34m\][\w]\[\033[31m\]\[\033[31m\]$(__git_ps1)\[\033[00m\] \$ ' | |
| #to show the current directory only eg.: "foo_project" |
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
| [alias] | |
| pp = !sh -c 'git pull && git push' |