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 | |
| # usage: | |
| # $ das_download.rb email password [download_directory] | |
| require 'mechanize' | |
| # gem 'mechanize-progressbar' | |
| email = ARGV[0] or raise('Please provide the email address for your account') | |
| password = ARGV[1] or raise('Please provide the password for your account') | |
| path = (ARGV[2] || './').gsub /\//,'' |
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
| User = Backbone.Model.extend({ | |
| login_attempts: 3, | |
| login: function(){ | |
| var that = this; | |
| var res = null; | |
| $.ajaxSetup({async:false}); | |
| $.post(SITE_PATH + 'user/login', $('form#loginform').serialize(), function(data){ | |
| try{ | |
| res = $.parseJSON(data); |
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
| require 'formula' | |
| class Vim < Formula | |
| homepage 'http://www.vim.org/' | |
| url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2' | |
| sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d' | |
| version '7.3.161' | |
| def features; %w(tiny small normal big huge) end | |
| def interp; %w(lua mzscheme perl python python3 tcl ruby) end |
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
| def new_plural (number, text) | |
| number == 1 ? text : text.pluralize | |
| end |
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
| ENV["I_LIKE_METHOD_ALIAS_CHAIN"] = "true" | |
| require 'rubygems' | |
| require 'haml' | |
| # performance optimizations. | |
| load 'paml.rb' | |
| pml = Paml.new | |