This file contains hidden or 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
function dailyStatsParser() { | |
var ss = SpreadsheetApp.openById("0AhDr-PBlhQuYdExJbFNCVkJUa28ybHRVMEUyaVdsUWc"); | |
var now = new Date(); | |
var yesterday = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1, now.getHours()); | |
var yesterdayString = Utilities.formatDate(yesterday, "CET", "yyyy-MM-dd"); | |
var fileNames = new Array("Tutti.ch stats ", "Tutti.ch (de) stats ", "Tutti.ch (fr) stats ", "Tutti.ch (it) stats "); | |
var docIDs = new Array(); |
This file contains hidden or 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 < ActiveRecord::Base | |
belongs_to :user | |
acts_as_voteable | |
has_attached_file :music, :storage => :s3, :s3_credentials => "#{Rails.root}/config/s3.yml" | |
validates_attachment_content_type :music, :content_type => ['application/mp3', 'application/x-mp3', 'audio/mpeg', 'audio/mp3' ], | |
:message => 'file must be of filetype .mp3!' |
This file contains hidden or 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 | |
before_filter :authenticate_user! | |
# GET /songs | |
# GET /songs.json | |
def index | |
@songs = Song.all | |
respond_to do |format| |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# This is the Skillpunch boostrap file. It will help you getting your dev | |
# environment up and running in no time! | |
# Execute this script from within the root folder of the project using: | |
# => `script/bootstrap` | |
# | |
require 'rubygems' | |
require 'colored' | |
require 'hpricot' |
This file contains hidden or 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 Category < ActiveRecord::Base | |
has_many :topics, :order => "name ASC" | |
has_many :entries, :through => :topics | |
# Public: Return an Array of categories with included topics | |
# and entries as hash values. | |
# | |
# search_results - An array of entries | |
# |
This file contains hidden or 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
songs_controller.rb | |
class SongsController < ApplicationController | |
before_filter :authenticate_user! | |
# GET /songs | |
# GET /songs.json | |
def index | |
@songs = Song.all |