Skip to content

Instantly share code, notes, and snippets.

View batasrki's full-sized avatar

Srdjan Pejic batasrki

  • S-Squared Design & Development
  • Toronto, ON
View GitHub Profile
#!/usr/bin/env ruby
require 'nokogiri'
path = ARGV.shift || File.join(ENV['HOME'], "Music/iTunes/iTunes Music Library.xml")
doc = Nokogiri.XML File.open(path)
tracks = []
doc.xpath('/plist/dict/dict/dict').each do |node|
children = node.children.map(&:text).reject { |x| x.strip.empty? }
@batasrki
batasrki / read_from_bottom
Created May 10, 2011 18:49
More recruiter shit
Perhaps we got off on the wrong foot and email messages never come across very well.
My intention was not to "lie" but simply to spread the word by whichever means has worked in the past.
I have a large (2000 connections) network who have been approached in a similar manor and have been ok with it.
I sincerely apologise if this has come across the wrong way, that was never my intention.
The "juicy" ness of the contract is for the rate that the client is offering the successful candidate, not for the minor margin I would make for finding the person.
I feel that my part in the whole recruitment process is to help good candidates find the right role and to help clients find talent. I know that when I was an contractor myself for 10 years,
recrutiment people were a constant frustration to me. That is why I try to build relationships,
@batasrki
batasrki / backup.rb
Created May 5, 2011 15:07 — forked from jschoolcraft/backup.rb
bit of my astrails-safe file, showing mysql command line batch execution
mysqldump do
options "-ceKq --single-transaction --create-options"
username = "some"
pass = "thing"
user username
password pass
socket "/var/run/mysqld/mysqld.sock"
require "stateful"
class Folder < ActiveRecord::Base
include Stateful
# ...
stateful do
state :active
state :inactive
require "stateful"
class Folder < ActiveRecord::Base
include Stateful
# ...
stateful do
state :active
state :inactive
if Rails.env.production?
Braintree::Configuration.environment = Rails.env.staging? ? :sandbox : :production
Braintree::Configuration.merchant_id = ENV["braintree_merchant_id"]
Braintree::Configuration.public_key = ENV["braintree_public_key"]
Braintree::Configuration.private_key = ENV["braintree_private_key"]
else
Braintree::Configuration.environment = :sandbox
Braintree::Configuration.merchant_id = "<super secret>"
Braintree::Configuration.public_key = "<super secret>"
Braintree::Configuration.private_key = "<super secret>"
# Monkey patching required for compatibility between MongoMapper (v. 0.8.6) and
# the master branch of Devise heading towards 1.2. It seems some methods have been moved
# around to different modules/classes within Devise since the 1.1 branch
module Devise
module Orm
module MongoMapper
module Hook
def devise_modules_hook!
extend Schema
#!/usr/bin/env bash
if [[ -s "/usr/local/rvm/environments/ruby-1.8.7-p334" ]] ; then
source "/usr/local/rvm/environments/ruby-1.8.7-p334"
exec ruby "$@"
else
echo "ERROR: Missing RVM environment file: '/usr/local/rvm/environments/ruby-1.8.7-p334'" >&2
exit 1
fi
@batasrki
batasrki / RVM vs Passenger, round 2
Created March 28, 2011 18:58
Server is Mac OS X Leopard (10.5); rvm installed as root; system gems imported as per install docs
#ran the command suggested below by passenger, it being
# 'rvm update --head && rvm reload && rvm repair all'
#only instead of rvm update --head, I did rvm get latest
rvm 1.5.2 by Wayne E. Seguin ([email protected]) [http://rvm.beginrescueend.com/]
Repairing symlinks...
Symlinks repaired
Repairing archives...
Archives repaired
@batasrki
batasrki / git deploy error
Created March 24, 2011 20:06
Can't deploy to a server; weird, ungoogleable error message
Hi,
So, I've a user account on Github under username batasrki.
I'm also a collaborator on a few private repos, one of them being themarknews.
While I had no issues previously, I've been having problems deploying from my machine (MacBook Pro) to a staging server.
I don't have a problem pushing changes up to themarknews' Github repo.