Open up Terminal.app
in your /Applications/Utilities
directory, then type in these commands, one after each other:
-
Create a temporary directory for cycript:
mkdir cycript && cd cycript
-
Pull the latest cycript from cycript.org:
<?php | |
/** | |
* Higher order functions in PHP | |
* | |
* Please let me know of any differences in the the uses and actual definitions of partial v. curry. | |
*/ | |
/** | |
* Returns a partially applied function. |
countZeroes :: [String] -> Int | |
countZeroes = sum . map length . map (filter (=='0')) | |
countZeroesAgain :: Show a => [a] -> Int | |
countZeroesAgain = countZeroes . map show | |
-- and for the one line, because I guess that's the challenge | |
-- btw, it's type is | |
-- cz :: Show a => [a] -> Int | |
-- which means that this function works any list of things that can be printed |
// New is a function that takes a function F | |
function New (F) { | |
var o = {}; // and creates a new object o | |
o.__proto__ = F.prototype // and sets o.__proto__ to be F's prototype | |
// New returns a function that... | |
return function () { | |
F.apply(o, arguments); // runs F with o as "this", passing along any arguments | |
return o; // and returns o, the new object we created | |
} |
sys = require("child_process"); | |
var Cat = function( name ){ | |
this.name = name; | |
}; | |
Cat.prototype.meow = function(){ | |
sys.exec('say "' + this.name + ' says MEEEEOOOOOOOOOWOWOWOW"'); | |
}; |
#these are meant to be run in a REPL, and the java one in beanshell of something of the sort: | |
#ruby | |
[1,2,3,4].select{ |x| x.even? } | |
#python | |
[x for x in [1,2,3,4] if not x%2] | |
#or, more norvingly | |
filter(lambda x: not x%2, [1,2,3,4]) | |
#clojure |
# -*- encoding: utf-8 -*- | |
require 'sinatra' | |
require 'slim' | |
require 'warden' | |
require 'dm-core' | |
require 'dm-migrations' | |
DataMapper::Logger.new(STDOUT, :debug) |
source :rubygems | |
gem 'sinatra' | |
gem 'json' | |
gem 'omniauth' | |
gem 'omniauth-oauth2' | |
gem 'omniauth-github' | |
# gem 'omniauth-att', :path => File.expand_path("./../../omniauth-att", __FILE__) | |
gem 'thin' |
__all__ = ( | |
'build', | |
'endode', | |
'decode', | |
) | |
phrase = 'A man a plan a canal Panama'.lower() | |
def build(phrase): | |
""" |
textarea:focus, | |
input[type="text"]:focus, | |
input[type="password"]:focus, | |
input[type="datetime"]:focus, | |
input[type="datetime-local"]:focus, | |
input[type="date"]:focus, | |
input[type="month"]:focus, | |
input[type="time"]:focus, | |
input[type="week"]:focus, | |
input[type="number"]:focus, |