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
(ns amen.core | |
(:require [overtone.live :refer :all])) | |
(def snare (freesound 26903)) | |
(def crash (freesound 26884)) | |
(def ride (freesound 26889)) | |
(def kick (freesound 26888)) | |
(def amen-tabs | |
[{:sound crash, :tab "----------------|----------------|----------------|----------x-----"} |
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
$ echo $GOPATH | |
$ echo $PATH | |
/bin:/usr/bin:/usr/local/bin | |
$ mkdir -p /tmp/some_project | |
$ touch /tmp/some_project/.goworkspace | |
$ cd /tmp/some_project | |
$ echo $GOPATH | |
/tmp/some_project | |
$ echo $PATH |
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
302 Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. | |
72 Extra empty line detected at block body end. | |
71 Extra empty line detected at block body beginning. | |
52 Extra empty line detected at class body beginning. | |
47 Final newline missing. | |
45 Extra empty line detected at class body end. | |
40 Align the operands of an expression in an assignment spanning multiple lines. | |
35 Extra blank line detected. | |
22 Trailing whitespace detected. | |
22 Tab detected. |
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
scss: | |
enabled: false | |
ruby: | |
config_file: .ruby-style.yml | |
javascript: | |
config_file: .jshintrc |
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
module Paperclip | |
class Padder < Thumbnail | |
def transformation_command | |
super + ["-gravity center", | |
"-background white", | |
"-extent", %["#{geometry_extent}"]] | |
end | |
def geometry_extent | |
"#{target_geometry.width.to_i}x#{target_geometry.height.to_i}" |
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
class User < ActiveRecord::Base | |
has_attached_file :image, | |
:styles => { | |
:large => "280x280#", | |
:medium => "130x130#", | |
:small => "50x50#", | |
:tiny => "30x30#" }, | |
:processors => [:thumbnail, :timestamper], | |
:date_format => "%Y%m%d%H%M%S" | |
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
module Paperclip | |
class TimeStamper < Processor | |
def initialize(file, options={}, attachment=nil) | |
super(file,options,attachment) | |
timestamp_filename | |
end | |
def timestamp_filename | |
original_filename = attachment.instance_read(:file_name) | |
extension = File.extname(original_filename) |
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
Mysql2::Error: Column 'id' in order clause is ambiguous: SELECT COUNT(*) AS count_all, users.id AS users_id FROM `users` LEFT JOIN followings ON users.id = followings.followee_id GROUP BY users.id WHERE COUNT(followings.followee_id) > 10 ORDER BY id desc | |
activerecord (3.0.7) lib/active_record/connection_adapters/abstract_adapter.rb:207:in `rescue in log' | |
activerecord (3.0.7) lib/active_record/connection_adapters/abstract_adapter.rb:199:in `log' | |
mysql2 (0.2.6) lib/active_record/connection_adapters/mysql2_adapter.rb:314:in `execute' | |
mysql2 (0.2.6) lib/active_record/connection_adapters/mysql2_adapter.rb:635:in `select' | |
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all' | |
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/query_cache.rb:54:in `block in select_all' | |
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/query_cache.rb:68:in `cache_sql' | |
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/query_cac |
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
module LayoutHelper | |
def page_description | |
description = case | |
when @question then @question.background | |
when @user && @user.bio.present? then @user.bio | |
when @user && @user.sports.present? then @user.sports_list | |
when @user && !@user.new_record? then "Tribesports user: #{@user.short_name}" | |
when @topic then @topic.body | |
when @tribe then @tribe.description |
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
# -*- encoding: utf-8 -*- | |
Gem::Specification.new do |s| | |
s.name = %q{draper} | |
s.version = "0.7.0" | |
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= | |
s.authors = ["Jeff Casimir"] | |
s.date = %q{2011-08-17 00:00:00.000000000Z} | |
s.description = %q{Draper reimagines the role of helpers in the view layer of a Rails application, allowing an object-oriented approach rather than procedural.} |
OlderNewer