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
# FIXME: You shouldn't do thatway! | |
def how_to_make_pizza( components, pizza_size ) | |
components.each do |component| | |
angle = rand( 2 * Math::PI * 1000 ).to_f / 1000 | |
dist = rand(pizza_size.to_i) | |
Fan << component.move_to( Position.new( dist * Math.cos( angle ), dist * Math.sin ( angle )).release | |
end | |
end |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
gem 'soundcloud-ruby-api-wrapper' | |
require 'soundcloud' | |
sc_client = Soundcloud.register | |
puts 'Enter search, like : fine-cut-bodies or just hit enter! :)' | |
search = gets.strip |
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
# .irbrc | |
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER') | |
require 'logger' | |
RAILS_DEFAULT_LOGGER = Logger.new(STDOUT) | |
end |
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
# config.yaml : (Load this into an OpenStruct at the initializers, as usual...) | |
# | |
# test_legnths: | |
# default: 20 | |
# title: 150 | |
# description_in_list: 450 | |
module ApplicationHelper |
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
# 1.8.7 enterprise ruby | |
sudo update-alternatives --install /usr/local/bin/ruby ruby /opt/ruby-enterprise-1.8.7-2010.01/bin/ruby 500 --slave /usr/local/bin/erb erb /opt/ruby-enterprise-1.8.7-2010.01/bin/erb --slave /usr/local/bin/gem gem /opt/ruby-enterprise-1.8.7-2010.01/bin/gem --slave /usr/local/bin/irb irb /opt/ruby-enterprise-1.8.7-2010.01/bin/irb --slave /usr/local/bin/rake rake /opt/ruby-enterprise-1.8.7-2010.01/bin/rake --slave /usr/local/bin/rdoc rdoc /opt/ruby-enterprise-1.8.7-2010.01/bin/rdoc --slave /usr/local/bin/ri ri /opt/ruby-enterprise-1.8.7-2010.01/bin/ri --slave /usr/local/bin/testrb testrb /opt/ruby-enterprise-1.8.7-2010.01/bin/testrb | |
# 1.9.1 ruby | |
sudo update-alternatives --install /usr/local/bin/ruby ruby /opt/ruby-1.9.1-p378/bin/ruby 400 --slave /usr/local/bin/erb erb /opt/ruby-1.9.1-p378/bin/erb --slave /usr/local/bin/gem gem /opt/ruby-1.9.1-p378/bin/gem --slave /usr/local/bin/irb irb /opt/ruby-1.9.1-p378/bin/irb --slave /usr/local/bin/rake rake /opt/ruby-1.9.1-p378/bin/rake --slave / |
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
import Tkinter | |
import datetime | |
import commands | |
class PomodoroTimer(): | |
""" | |
Simple pomodoro timer app | |
""" | |
def __init__(self): |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
private int myVar; |
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
[share] | |
comment = Share | |
path = /home/kisp/smb | |
browseable = true | |
guest ok = yes | |
create mask = 0775 | |
directory mask = 0775 | |
follow symlinks = yes | |
wide links = yes | |
unix extensions = no |
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
# ssh completion | |
if [ -f ~/.ssh/config ] ; then | |
SSH_COMPLETE=( $(grep "^Host " ~/.ssh/config | cut -f2 -d ' ' | sort -u ) ) | |
SSH_COMPLETE=( ${SSH_COMPLETE[*]} $(grep "\w*User " ~/.ssh/config | cut -f2 -d ' ' | sort -u ) ) | |
fi | |
if [ -f ~/.ssh/known_hosts ] ; then | |
SSH_COMPLETE=( ${SSH_COMPLETE[*]} $(cut -f1 -d' ' ~/.ssh/known_hosts | cut -f1 -d',' | sort -u )) | |
fi | |
complete -o default -W "${SSH_COMPLETE[*]}" ssh | |
complete -o default -W "${SSH_COMPLETE[*]}" scp |
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
function ln() { | |
echo "WARNING! 'ln' is an unsupported command on this platform." | |
echo " * The following command was called:" | |
echo "ln $@" | |
if [ $1 = "-s" ] ; then | |
echo " * Trying to translate it to a simple copy command : " | |
COMMAND="cp -R $2 $3" | |
echo "$COMMAND" |
OlderNewer