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 CoursesController < ApplicationController | |
require "rexml/document" | |
require "net/http" | |
require "multipart" | |
include REXML | |
before_filter :check_login, :only => ['new', 'create', 'admin_pub'] | |
before_filter :login_required, :except => ['index', 'list', 'search', 'show'] | |
before_filter :check_permissions, :only => ['edit', 'update'] |
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
#!/bin/sh | |
RSYNC_DEFAULT_OPTIONS="-r -t -v -L --delete --stats --progress" | |
RSYNC_TEMP_DIR="./tmp_rsync_dir/" | |
# Sources | |
ITUNES_PODCASTS_DIR="/Users/adam/Music/iTunes/iTunes Music/Podcasts/" | |
ITUNES_MUSIC_DIR="/Users/adam/Music/iTunes/iTunes Music/" | |
ALBUMS=( | |
"Bone Thugs-N-Harmony/Strength & Loyalty" |
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
<html> | |
<head> | |
<style type="text/css"> | |
h2 { | |
text-align: center; | |
} | |
div#minute-converter { | |
background: #cfcfcf; | |
width: 500px; | |
height: 725px; |
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
var SITE = SITE || {}; | |
SITE.fileInputs = function() { | |
var $this = $(this), | |
$val = $this.val(), | |
valArray = $val.split('\\'), | |
newVal = valArray[valArray.length-1], | |
$button = $this.siblings('.button'), | |
$fakeFile = $this.siblings('.file-holder'); | |
if(newVal !== '') { |
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
# config/locales/en.yml | |
en: | |
errors: | |
messages: | |
wrong_size: "is the wrong size (should be %{file_size})" | |
size_too_small: "is too small (should be at least %{file_size})" | |
size_too_big: "is too big (should be at most %{file_size})" |
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
# encoding: utf-8 | |
class AvatarUploader < CarrierWave::Uploader::Base | |
include CarrierWave::MiniMagick | |
# Choose what kind of storage to use for this uploader: | |
storage :file | |
# Override the directory where uploaded files will be stored. |
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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
- (IBAction)startThePlan:(id)sender { | |
ScheduleViewController *scheduleVC = [[ScheduleViewController alloc] initWithNibName:nil bundle:nil]; | |
[self.navigationController pushViewController:scheduleVC animated:YES]; | |
NSMutableArray *allViewControllers = [NSMutableArray arrayWithArray:self.navigationController.viewControllers]; | |
int length = [allViewControllers count]; | |
[allViewControllers objectAtIndex:length-1]; // remove confirmation view | |
[allViewControllers objectAtIndex:length-2]; // remove start date view | |
[allViewControllers objectAtIndex:length-3]; // remove plan selection view |
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
var codeset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
var base = codeset.length; | |
function encode(intStr) { | |
var hash = ""; | |
intStr = parseInt(intStr); | |
while (intStr > 0) { | |
hash = self.codeset[parseInt(intStr % base)] + hash; | |
intStr = Math.floor(intStr / base); | |
} |
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 | |
PRESUMPTIVE_RAILS_ROOT = "/data/[APP_NAME]/current" | |
LOG_PATH = "/data/[APP_NAME]/shared/log/delayed_job_singleton.log" | |
Dir.chdir PRESUMPTIVE_RAILS_ROOT | |
require 'home_run' | |
require "rubygems" | |
require "bundler/setup" |
OlderNewer