Skip to content

Instantly share code, notes, and snippets.

Avatar

Darion Miller Showtimes

View GitHub Profile
View Fade in
$(window).load(function(){
$('body').ready(function() {
$('logo.png').hide();
$('logo.png').each(function(i) {
if (this.complete) {
$(this).fadeIn();
} else {
$(this).load(function() {
$(this).fadeIn(2000);
});
View gist:5164060
$.plot($("#graph7"), data,
{
series: {
pie: {
show: true,
combine: {
color: '#999',
threshold: 0.1
}
}
View gist:5100252
.navbar-search{ :action => search_path, :method => "post" }
.input.search-query{ :name => "query", :class=>@query.blank? ? "swap_value" : "", :type => "text", :value => @query.blank? ? "Find your wine" : @query, :size => 80 }
View gist:5095129
<h1>Raffler</h1>
<div ng-controller="RaffleCtrl">
<form ng-submit="addEntry()">
<input type="text" ng-model="newEntry.name">
<input type="submit" value="Add">
</form>
<ul>
<li ng-repeat="entry in entries">
View gist:5095113
$scope.addEntry = ->
$scope.entries.push($scope.newEntry)
$scope.newEntry = {}
$scope.drawWinner = ->
pool = []
angular.forEach $scope.entries, (entry) ->
pool.push(entry) if !entry.winner
if pool.length > 0
@Showtimes
Showtimes / database.yml
Created Nov 20, 2012
database.yml mysql2
View database.yml
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
View error
middleware/request/oauth2.rb:62: warning: already initialized constant OAuth2
=> Booting WEBrick
=> Rails 3.2.8 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/davidwigder/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:297:in `initialize': no implicit conversion from nil to integer (TypeError)
from /Users/davidwigder/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:297:in `open'
from /Users/davidwigder/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:297:in `load_file'
from /Users/davidwigder/Desktop/rails_projects/emuze/config/initializers/tire.rb:1:in `<top (required)>'
View metaphone.rb
def self.lookup(str, pos, length, last)
case str[pos, 1]
when /^A|E|I|O|U|Y$/
if 0 == pos
return 'A', 'A', 1
else
return nil, nil, 1
end
when 'B'
return 'P', 'P', ('B' == str[pos + 1, 1] ? 2 : 1)
@Showtimes
Showtimes / gist:3277867
Created Aug 6, 2012
Stripe Gist Supscription Model
View gist:3277867
class Subscription < ActiveRecord::Base
# Associations
belongs_to :user
has_many :payments, :dependent => :destroy
has_many :fulfillments, :dependent => :destroy
# Accessibles
attr_accessible :plan_type, :major_focus, :minor_focus, :start_date
# Validations
#validates :user, :presence => true