Skip to content

Instantly share code, notes, and snippets.

View code-later's full-sized avatar

Dirk Breuer code-later

View GitHub Profile
@code-later
code-later / pony.rb
Created July 2, 2013 18:43
Shoes Pony Example for SIGINT
Shoes.app width: 600, height: 600 do
@knopf = button("Start", left: 300, top: 300) do
@pinky = image "/Users/dbreuer/Desktop/pinkie.png", width: 120, left: 0
@dash = image "/Users/dbreuer/Desktop/dash.png", width: 120, left: 400
@knopf.hide
end
#@mein_kreis = oval(0, 100, 25, fill: red, stroke: pink)
#animate 60 do
@code-later
code-later / pinkiepie.yml
Created October 9, 2013 14:06
Pinkie Pie color schema to be used with base16 builder (https://github.com/chriskempson/base16-builder)
scheme: "PinkiePie"
author: "Dirk Breuer (http://tfcl.de)"
base00: "151515"
base01: "202020"
base02: "303030"
base03: "505050"
base04: "b0b0b0"
base05: "d0d0d0"
base06: "e0e0e0"
base07: "f5f5f5"
@code-later
code-later / podcast.rb
Created October 19, 2013 15:09
Sample Guacamole Model
class Podcast
include Guacamole::Model
attribute :title, String
attribute :body, String
# Timestamp attributes are automatically added (created_at, updated_at)
end
@code-later
code-later / README.markdown
Created November 15, 2013 22:52
Export your Octopress files to Ghost

This is a very rough script to export your octopress files to Ghost. You will still need to check your data but it will give you a head start. Feel free to fork and optimize the script for your purpose.

The following should be considered:

  1. You need to execute the script in the source/_posts directory
  2. You need to manually copy all the images to /var/www/ghost/content/images
  3. Images with external URLs are not handled
  4. Blockquotes have their issues
  5. Lists are not exported correctly
@code-later
code-later / keyword_or_method.rb
Created May 1, 2014 12:33
private: Keyword or Method #Ruby
class Foo
send :private
def bar
puts "I'm private"
end
end
Foo.new.bar
# private method `bar' called for #<Foo:0x00000102816480> (NoMethodError)
GIT
remote: https://github.com/rom-rb/devtools.git
revision: b2614406dd87d5ea30946da90b9c9a532905472e
specs:
devtools (0.0.2)
PATH
remote: .
specs:
guacamole (0.1.0)
@code-later
code-later / build.sh
Created July 3, 2014 14:51
Problems with building ArangoDB 2.2 on OS X 10.9
make clean
make setup
./configure --enable-all-in-one-v8 --enable-all-in-one-libev --enable-all-in-one-icu --enable-relative --enable-maintainer-mode --with-bison=/usr/local/Cellar/bison/3.0.2/bin/bison
make -j4
@code-later
code-later / debug_guacamole.sh
Created August 16, 2014 11:19
Help debugging Guacamole
#!/usr/bin/env bash
bundle exec rake db:guacamole:purge
bundle exec rails runner 'users_count = UsersCollection.all.count; puts "There are #{users_count} users in the DB!"'
echo "Creating a test user Bob..."
bundle exec rails runner 'u = User.new(username: "Bob", password: "123456", password_confirmation: "123456"); UsersCollection.save u'
echo "Fetching the user from the DB..."
@code-later
code-later / mcabber_notifier.rb
Created September 3, 2014 08:56
OS X Notification Center for mcabber
#!/usr/bin/env ruby
require 'logger'
require 'terminal-notifier'
type, direction, jid = ARGV
if type == 'MSG' && direction == 'IN'
TerminalNotifier.notify "Message from #{jid}",
group: jid,
@code-later
code-later / gh2trello.rb
Created September 25, 2014 11:50
Creates Trello cards in the Backlog based on open GitHub issues with the link to the issue as description
require 'trello'
@repo, @prefix = ARGV
Trello.configure do |config|
config.developer_public_key = TRELLO_DEVELOPER_PUBLIC_KEY
config.member_token = TRELLO_MEMBER_TOKEN
end
require 'octokit'