NSTimer is a great example of an over-verbose, outdated Objective-C API. To run a simple line of code after a delay, you need to write a lot of boilerplate crap.
How about this:
NSTimer.schedule(5.seconds) {
  println("Hello world!")
}| storage = Fog::Storage.new( | |
| provider: 'AWS', | |
| aws_access_key_id: 'xxx', | |
| aws_secret_access_key: 'yyy', | |
| path_style: true | |
| ) | |
| directory = storage.directories.get('yourbucket') | |
| uploaded = directory.files.create( | |
| key: "324324.jpg", | 
| Selectize.define( 'clear_selection', function ( options ) { | |
| var self = this; | |
| //Overriding because, ideally you wouldn't use header & clear_selection simultaneously | |
| self.plugins.settings.dropdown_header = { | |
| title: 'Clear Selection' | |
| }; | |
| this.require( 'dropdown_header' ); | |
| self.setup = (function () { | 
| # lib/tasks/db.rake | |
| namespace :db do | |
| desc "Dumps the database to db/APP_NAME.dump" | |
| task :dump => :environment do | |
| cmd = nil | |
| with_config do |app, host, db, user| | |
| cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump" | |
| end | |
| puts cmd | 
NSTimer is a great example of an over-verbose, outdated Objective-C API. To run a simple line of code after a delay, you need to write a lot of boilerplate crap.
How about this:
NSTimer.schedule(5.seconds) {
  println("Hello world!")
}| /* | |
| You need to import EventKit | |
| import EventKit | |
| */ | |
| @IBAction func buttonCalendar(sender: AnyObject) { | |
| var eventStore : EKEventStore = EKEventStore() | |
| // 'EKEntityTypeReminder' or 'EKEntityTypeEvent' | 
| <form class="form-horizontal" role="form"> | |
| <div class="form-group"> | |
| <label for="sampleAutocomplete" class="col-sm-3 control-label">Sample Autocomplete</label> | |
| <div class="col-sm-9"> | |
| <input type="text" class="autocomplete form-control" id="sampleAutocomplete" data-toggle="dropdown" /> | |
| <ul class="dropdown-menu" role="menu"> | |
| <li><a>Action</a></li> | |
| <li><a>Another action</a></li> | |
| <li><a>Something else here</a></li> | |
| <li><a>Separated link</a></li> | 
| func timeAgoSinceDate(date:NSDate, numericDates:Bool) -> String { | |
| let calendar = NSCalendar.currentCalendar() | |
| let unitFlags = NSCalendarUnit.CalendarUnitMinute | NSCalendarUnit.CalendarUnitHour | NSCalendarUnit.CalendarUnitDay | NSCalendarUnit.CalendarUnitWeekOfYear | NSCalendarUnit.CalendarUnitMonth | NSCalendarUnit.CalendarUnitYear | NSCalendarUnit.CalendarUnitSecond | |
| let now = NSDate() | |
| let earliest = now.earlierDate(date) | |
| let latest = (earliest == now) ? date : now | |
| let components:NSDateComponents = calendar.components(unitFlags, fromDate: earliest, toDate: latest, options: nil) | |
| if (components.year >= 2) { | |
| return "\(components.year) years ago" | 
| wget http://www.currencysymbols.in/flags/afghanistan.png -O AFN.png | |
| wget http://www.currencysymbols.in/flags/argentina.png -O ARS.png | |
| wget http://www.currencysymbols.in/flags/aruba.png -O AWG.png | |
| wget http://www.currencysymbols.in/flags/australia.png -O AUD.png | |
| wget http://www.currencysymbols.in/flags/azerbaijan.png -O AZN.png | |
| wget http://www.currencysymbols.in/flags/bahamas.png -O BSD.png | |
| wget http://www.currencysymbols.in/flags/barbados.png -O BBD.png | |
| wget http://www.currencysymbols.in/flags/belarus.png -O BYR.png | |
| wget http://www.currencysymbols.in/flags/belize.png -O BZD.png | |
| wget http://www.currencysymbols.in/flags/bermuda.png -O BMD.png | 
| 'use strict'; | |
| module.exports = function CustomError(message, extra) { | |
| Error.captureStackTrace(this, this.constructor); | |
| this.name = this.constructor.name; | |
| this.message = message; | |
| this.extra = extra; | |
| }; | |
| require('util').inherits(module.exports, Error); | 
| #!/usr/bin/env ruby | |
| # Validates that you don't commit forbidden keywords to the repo | |
| # You can skip this checking with 'git commit --no-verify' | |
| exit 0 if ARGV.include?('--no-verify') | |
| # Update this list with your own forbidden keywords | |
| KEYWORDS = %w(binding.pry console.log debugger) | |
| def red(text) "\033[31m#{text}\033[0m"; end |