(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| // | |
| // NSFont+SystemFont.h | |
| // xScope | |
| // | |
| // Created by Craig Hockenberry on 4/17/14. | |
| // | |
| // Thanks to http://nshipster.com/method-swizzling/ | |
| #import <Cocoa/Cocoa.h> |
| # Do *not* load any libs here that are *not* part of Ruby’s standard-lib. Ever. | |
| desc "Install all dependencies" | |
| task :bootstrap do | |
| if system('which bundle') | |
| sh "bundle install" | |
| sh "git submodule update --init" | |
| # etc | |
| else | |
| $stderr.puts "\033[0;31m[!] Please install the bundler gem manually: $ [sudo] gem install bundler\e[0m" |
| #!/usr/bin/env coffee | |
| # | |
| http = require('http') | |
| cheerio = require('cheerio') | |
| spawn = require('child_process').spawn | |
| searchTerm = process.argv[2..-1].join(' ') |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| // | |
| // JAZMusician.h | |
| // JazzyApp | |
| // | |
| #import <Foundation/Foundation.h> | |
| /** | |
| JAZMusician models, you guessed it... Jazz Musicians! | |
| From Ellington to Marsalis, this class has you covered. |
| // | |
| // CollectionViewDataSource.swift | |
| // Khan Academy | |
| // | |
| // Created by Andy Matuschak on 10/14/14. | |
| // Copyright (c) 2014 Khan Academy. All rights reserved. | |
| // | |
| import UIKit |
| // | |
| // MultiDirectionAdjudicatingScrollView.swift | |
| // Khan Academy | |
| // | |
| // Created by Andy Matuschak on 12/16/14. | |
| // Copyright (c) 2014 Khan Academy. All rights reserved. | |
| // | |
| import UIKit | |
| import UIKit.UIGestureRecognizerSubclass |
| """ | |
| Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
| BSD License | |
| """ | |
| import numpy as np | |
| # data I/O | |
| data = open('input.txt', 'r').read() # should be simple plain text file | |
| chars = list(set(data)) | |
| data_size, vocab_size = len(data), len(chars) |
So... this is obviously totally, 100%, like for. real. not. supported. by. Apple. …yet?
But still... I thought it was pretty badass. And, seeing how there's already a Swift buildpack for Heroku you could move some slow code into Swift can call it as a library function. But, you know, not in production or anything. That would be silly, right?
Now, having said that, the actual Python/Swift interop may have bugs. I'll leave that as an exercise to the reader.
| # In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env | |
| # variable pointing GPG to the gpg-agent socket. This little script, which must be sourced | |
| # in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start | |
| # gpg-agent or set up the GPG_AGENT_INFO variable if it's already running. | |
| # Add the following to your shell init to set up gpg-agent automatically for every shell | |
| if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then | |
| source ~/.gnupg/.gpg-agent-info | |
| export GPG_AGENT_INFO | |
| else |