Skip to content

Instantly share code, notes, and snippets.

View therod's full-sized avatar

Rodrigo therod

View GitHub Profile
@therod
therod / pdf2tif
Created August 27, 2012 00:19
pdf2tif
#!/usr/bin/env ruby
require 'pathname'
OPTIONS = "-q -dNOPAUSE -dBATCH -dSAFER -r300x300 -sDEVICE=tiff24nc"
INPUT = ARGV[0]
OUTPUT = File.basename(INPUT, '.*') + ".tif"
`gs #{OPTIONS} -sOutputFile="#{OUTPUT}" -c save pop -f "#{INPUT}"`
@therod
therod / gist:3491002
Created August 27, 2012 18:14
rocr-folder
#!/usr/bin/env ruby
require 'rocr'
files = Dir.glob("#{ARGV.first}/*_Bild.pdf")
Dir.chdir(ARGV.first)
puts "WORKING DIRECTORY: #{Dir.pwd}"
files.each do |file|
puts "Converting: #{file}"
I'm sorry, but I have to admit, there are things in this world, which are - unfortunately awesome.
Cars cause pollution, the environment suffers, but a fancy new ride is - unfortunately awesome.
I'm chewing on a crayon, mom tells me to 'Stop it!', but it relaxes me - unfortunately awesome.
Diagnosis: psychosis!, I don't care, a joint first thing in the morning - unfortunately awesome.
"Stop nuclear energy!" you hear them screaming and I charge my smartphone - unfortunately awesome.
Finally a new job, gotta' get up early in the morning, getting wasted in a pub - unfortunately awesome.
My teeth are rotten, but they don't hurt yet, I'm not going to the dentist - unfortunately awesome.
I'm decorating drunken friends, it's mean indeed, - but unfortunately awesome.
Bad for the offspring, bad for the North-sea, bad for your head - but unfortunately awesome.
#!/bin/bash
# Install rbenv
# https://github.com/sstephenson/rbenv
cd ~
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> .bash_profile
echo 'eval "$(rbenv init -)"' >> .bash_profile
--
-- An example, simple ~/.xmonad/xmonad.hs file.
-- It overrides a few basic settings, reusing all the other defaults.
--
import XMonad
main = xmonad $ defaultConfig
{ borderWidth = 2
, terminal = "urxvt"

As with our colleges, so with a hundred "modern improvements"; there is an illusion about them; there is not always a positive advance.

The devil goes on exacting compound interest to the last for his early share and numerous succeeding investments in them. Our inventions are wont to be pretty toys, which distract our attention from serious things. They are but improved means to an unimproved end, an end which it was already but too easy to arrive at; as railroads lead to Boston or New York.

We are in great haste to construct a magnetic telegraph from Maine to Texas; but Maine and Texas, it may be, have nothing important to communicate. Either is in such a predicament as the man who was earnest to be introduced to a distinguished deaf woman, but when he was presented, and one end of her ear trumpet was put into his hand, had nothing to say.

*As if the main object were to talk fast and not to talk sensibly. We are eager to tunnel under the Atlantic and bring the Old World some weeks nearer to the New

require 'slack'
require 'json'
Slack.configure do |config|
config.token = "xxx"
end
auth = Slack.auth_test
client = Slack.realtime
@therod
therod / clear_channel.rb
Created June 30, 2015 19:59
ruby script that deletes all messages from a defined channel
require 'slack'
require 'json'
Slack.configure do |config|
config.token = ENV['SLACK_TOKEN']
end
Slack.auth_test
general = "C06S8GRSL"
#! /bin/sh
echo $1 $2
mkdir "$2".iconset
sips -z 16 16 "$1" --out "$2".iconset/icon_16x16.png
sips -z 32 32 "$1" --out "$2".iconset/icon_16x16@2x.png
sips -z 32 32 "$1" --out "$2".iconset/icon_32x32.png
sips -z 64 64 "$1" --out "$2".iconset/icon_32x32@2x.png