$> for i in $(find . -type f -name "*[A-Z]*"); do mv "$i" "$(echo $i | tr A-Z a-z)"; done$> for i in $(find . -type f -name "*[a-z]*"); do mv "$i" "$(echo $i | tr '-' '_')"; done| #!/usr/bin/env ruby | |
| # | |
| # Ruby script to download a number of files | |
| # from individual URLs via HTTP/HTTPS/FTP | |
| # specified in an external file. | |
| # | |
| # Author: Tobias Preuss | |
| # Revision: 2013-04-18 16:26 +0100 UTC | |
| # License: Creative Commons Attribution-ShareAlike 3.0 Unported |
| #!/usr/bin/env python | |
| import scraperwiki | |
| import requests | |
| import lxml.html | |
| from collections import namedtuple | |
| from datetime import datetime | |
| /* | |
| * The plugins used for this build. | |
| */ | |
| /* | |
| * Provides the compile, test, jar, etc tasks | |
| */ | |
| apply plugin: 'java' | |
| /* | |
| * Generates the Eclipse project files. |
| build | |
| node_modules | |
| .DS_Store |
#GDG Android in Berlin brainstorming session
On November 27, 2013 I was asking the brilliant Android developers at GDG Android in Berlin for their favorite libraries that make their lives easier and should be included in every newly developed app.
This is the list of libraries we collected during this 10 minute session.
| require 'addressable/uri' | |
| # Source: http://gist.github.com/bf4/5320847 | |
| # Accepts options[:message] and options[:allowed_protocols] | |
| # spec/validators/uri_validator_spec.rb | |
| class UriValidator < ActiveModel::EachValidator | |
| def validate_each(record, attribute, value) | |
| uri = parse_uri(value) | |
| if !uri |
| class Api::RegistrationsController < Api::BaseController | |
| respond_to :json | |
| def create | |
| user = User.new(params[:user]) | |
| if user.save | |
| render json: user.as_json(auth_token: user.authentication_token, email: user.email), status: :created | |
| return | |
| else |