Skip to content

Instantly share code, notes, and snippets.

Feyyaz Alingan freshfey

Block or report user

Report or block freshfey

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View google-script
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(" stats ", " (de) stats ", " (fr) stats ", " (it) stats ");
var docIDs = new Array();
View gist:3168759
class Song < ActiveRecord::Base
belongs_to :user
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!'
freshfey / gist:3168757
Created Jul 24, 2012
Songs Controller
View gist:3168757
class SongsController < ApplicationController
before_filter :authenticate_user!
# GET /songs
# GET /songs.json
def index
@songs = Song.all
respond_to do |format|
View gist:3168755
#!/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'
View categorysnippet.rb
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
View artistsurfer question
class SongsController < ApplicationController
before_filter :authenticate_user!
# GET /songs
# GET /songs.json
def index
@songs = Song.all
You can’t perform that action at this time.