Skip to content

Instantly share code, notes, and snippets.

@valakirka
valakirka / banana_bread.md
Last active September 17, 2022 15:47
Banana bread

Banana bread

Ingredients

  • 3 very ripe bananas
  • 2 eggs
  • 220gr brown sugar
  • 8 tbsp butter
  • 250gr flour
  • 1 tsp backing powder
  • 1 tsp backing soda
  • A handful of chopped walnuts
@valakirka
valakirka / torrijas.md
Created May 12, 2017 06:52
Torrijas' recipe

Ingredients

  • One long 2-day-stale bread loaf (baguette will do)
  • Milk (at least 1/2 liter)
  • Lemon zest
  • Cinnamon stick
  • 1/2 vanilla bean
  • 1/2 glass of anís dulce (this is hard to find in Berlin, but spotted at Mite Meer)
  • 3 eggs
#----------------------------------PLEASE NOTE--------------------------------#
#This file is the author's own work and represents their interpretation of the#
#song. You may only use this file for private study, scholarship, or research.#
#-----------------------------------------------------------------------------#
Date: Wed, 31 May 1995 08:54 +1200 (NZST)
Subject: tab : Aubade - Bartoli
Aubade - Bartoli
~~~~~~
Estudio 6
~~~~~~~~~
By: Leo Brouwer (1939-)
Transcribed from: "Portrait" by Kavi
Transcribed and tabbed by: John Kean
Standard tuning.
6/4 time, changing to 4/4 near the end.
Allegro (MM = 138).
@valakirka
valakirka / post.rb
Created August 7, 2012 16:54
Sphinx scope
class Contents::Post < Contents::Base
has_many :content_members, :as => :memberable, :dependent => :destroy
has_many :members, :through => :content_members, :class_name => "Contents::Member"
belongs_to :kt_blog, :class_name => 'Kontent::KtBlog', :touch => true
has_many :blog_categories, :through => :kt_blog, :class_name => "Kontent::KtBlogCategory"
validates_presence_of :title
validates_presence_of :summary, :unless => Proc.new {|post| post.body.present?}
validates_presence_of :kt_blog_id
@valakirka
valakirka / example.rb
Created May 18, 2012 16:33
Indexes and custom sphinx_select searches
class NewsEntry < AR::Base
has_one :association
define_index do
index wadus
has association.published_at, :as => :published_at
end
end
@valakirka
valakirka / ckeditor_helper.rb
Created February 24, 2012 16:54
CKEDITOR re-configuration from view
def ckeditor_textarea(object, field, options = {})
options = options.dup.symbolize_keys
var = options.delete(:object) if options.key?(:object)
var ||= @template.instance_variable_get("@#{object}")
value = var.send(field.to_sym) if var
value ||= options.delete(:value) || ""
element_id = options.delete(:id) || ckeditor_element_id(object, field, options.delete(:index))
@valakirka
valakirka / jazzfonica.rb
Created June 14, 2011 13:51 — forked from christos/jazzfonica.rb
jazzfonica
#!/usr/bin/env ruby
# jazzfonica.rb for Mac OS X
# Scans the visible networks for JAZZTEL_XXXX or WLAN_XXXX and calculates the password
# Ported from PHP example at http://kz.ath.cx/wlan/codigo.txt
# Download and execute with ruby (e.g. ruby jazzfonica.rb) from a Terminal
require 'digest/md5'
messages = []
unless !File.exists?('/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport')
namespace :assets do
desc "Normalize all Candidate attachments names"
task :normalize => :environment do
Candidate.find(:all, :conditions => ['candidates.id >= ? AND candidates.avatar_file_name IS NOT ?', ENV['RESUME'] || 1, nil]).each do |candidate|
@old_paths = {}
@bucket = ENV['BUCKET'] || 'jobandtalent_staging'
begin
%w{original identity contact profile}.each do |style|
@old_paths.merge!({style => candidate.avatar.path(style)})
end
# Slightly improved version of http://github.com/qoobaa/s3/blob/master/extra/s3_paperclip.rb, with support
# for buckets in locations other than standard US.
# S3 backend for paperclip plugin. Copy the file to:
# +config/initializers/+ directory
#
# Example configuration for CNAME bucket:
#
# has_attached_file :image,