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
debug_http () { | |
curl $@ -o /dev/null -w "dns: %{time_namelookup} connect: %{time_connect} | |
pretransfer: %{time_pretransfer} starttransfer: %{time_starttransfer} total: %{time_total}\n" ; | |
} |
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 java.awt.*; | |
import java.awt.geom.*; | |
import java.awt.event.*; | |
import javax.swing.*; | |
public class app { | |
public static void main(String [] args) { | |
Window w = new Window(); | |
w.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
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 Song | |
include MongoMapper::Document | |
plugin Grip | |
attachment :mp3 | |
key :title, String | |
key :artist, String | |
key :album, String | |
key :genre, String |
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 SongsController < ApplicationController | |
def index | |
@songs = Song.all(:destroyed_at => nil) | |
@totals = load_totals(@songs) | |
end | |
def new | |
@song = Song.new | |
render :layout => false |
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 Event | |
include MongoMapper::Document | |
include MultiParameterAttributes | |
key :name, String, :required => true | |
key :start_date, Date, :required => true | |
key :start_time, Time, :required => true | |
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
class BaseModel < CouchRest::ExtendedDocument | |
include ActiveModel::Dirty | |
use_database DB | |
def initialize(passed_keys={}, options={}) | |
super(passed_keys, options) | |
@changed_attributes = {} | |
end | |
class <<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
vendor/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/json/encoding.rb:111:in `unpack' | |
vendor/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/json/encoding.rb:111:in `escape' | |
vendor/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/json/encoding.rb:106:in `gsub' | |
vendor/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/json/encoding.rb:106:in `escape' | |
vendor/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/json/encoding.rb:51:in `escape' | |
vendor/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/json/encoding.rb:157:in `encode_json' | |
vendor/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/json/encoding.rb:46:in `encode' | |
vendor/bundler/gems/rails-16a5e918a06649ffa |
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
def create | |
@video = Video.new(params[:video]) | |
if @video.save | |
@video.put_attachment('clip', params[:video][:file]) | |
flash[:notice] = 'Video created succes!' | |
redirect_to admin_videos_path | |
else | |
flash[:notice] = 'Video created is fail!' | |
render :action => :new |
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 BaseModel < CouchRest::ExtendedDocument | |
include CouchRest::Validation | |
extend ActiveModel::Naming | |
include ActiveModel::Conversion | |
include Dirty | |
include Uniq | |
use_database DB | |
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
def create | |
attach = params[:video].delete(:file) | |
@video = Video.new(params[:video]) | |
if @video.save | |
@video.put_attachment('clip', attach.read) | |
flash[:notice] = 'Video created succes!' | |
redirect_to admin_videos_path | |
else | |
flash[:notice] = 'Video created is fail!' |
OlderNewer