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
| find . -size +1M | while read file_name; do sips $file_name --resampleWidth 900 ; done |
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
| #!/bin/bash | |
| QUERY=$* | |
| # Split Alfred query into parts: | |
| SOURCE_LANGUAGE=`echo "$QUERY" | awk '{ print $1; }' ` | |
| DESTINATION_LANGUAGE=`echo "$QUERY"| awk '{ print $2; }' ` | |
| # Transform the text to something Google translate understands | |
| set +o histexpand |
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
Show hidden characters
| { | |
| "ensure_newline_at_eof_on_save": true, | |
| "fade_fold_buttons": false, | |
| "font_size": 9, | |
| "highlight_line": true, | |
| "line_padding_bottom": 1, | |
| "line_padding_top": 1, | |
| "tab_size": 2, | |
| "translate_tabs_to_spaces": true, | |
| "trim_automatic_white_space": true, |
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
| class Pool | |
| def initialize(size) | |
| @size = size | |
| @jobs = Queue.new | |
| @pool = Array.new(@size) do |i| | |
| Thread.new do | |
| Thread.current[:id] = i | |
| catch(:exit) do | |
| loop do | |
| job, args = @jobs.pop |
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 | |
| # autor: Rafael Polo | |
| # data: 18.08.2013 | |
| # Prova de Conceito: É possível utilizar os incríveis 1024 gigabytes de armazenamento de imagens | |
| # do Flickr pra hospedar o valioso Acervo do MakingOff através de esteganografia ! | |
| # Motivação: Usuários torrents têm sido preza fácil pra associações anti-pirataria. | |
| # O Acervo hoje tem cerca de 18 TB de conteúdo distribuído, muitos já inacessíveis. | |
| # Algumas contas no Flickr seriam suficientes pra distribuir todo conteúdo ainda acessível. |
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 'rubygems' | |
| require 'sanitize' | |
| require 'mechanize' | |
| URL = "http://www.desaparecidospoliticos.org.br" | |
| browser = Mechanize.new | |
| browser.user_agent_alias = 'Mac Safari' | |
| puts "Listando..." | |
| browser.get("#{URL}/pessoas.php?m=3") do |lista| | |
| lista.search('//a[starts-with(@href, "pessoa.php?id=")]').each do |link| |
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
| #slides.carousel.slide | |
| %ol.carousel-indicators | |
| - i = 0 | |
| - @noticias.each do |n| | |
| - if i == 0 | |
| %li.active{"data-slide-to" => i, "data-target" => "#slides"} | |
| - else | |
| %li{"data-slide-to" => i, "data-target" => "#slides"} | |
| - i=+1 | |
| .carousel-inner |
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
| class Ponto | |
| ... | |
| before_save :detect_overgain | |
| def detect_overgain | |
| return false if Ponto.where(:identidade_id=>self.identidade.id).where('created_at > ?', 1.day.ago).where(:motivo=>self.motivo).count > 0 | |
| end |
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
| #{@texto} | |
| %hr | |
| %span Mensagem enviada | |
| %br | |
| - if @atual.grupo? | |
| %span= "pelo Grupo " | |
| - else | |
| %span= "por " | |
| %span= link_to @atual.use_name, "/#{@atual.urlized}" |
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 | |
| namespace :minc do | |
| desc "Crawleia Minc" | |
| task :grab => :environment do | |
| puts | |
| puts "="*70 | |
| puts "\t\t\t- Crawleando MinC -" | |
| puts "\t\t\t"+Time.new.strftime("%Y-%m-%d %H:%M:%S") | |
| puts "="*70 |