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:
import Either | |
--main = asText (filterrr (\x -> x > 2) [1, 2, 3, 4]) | |
main = asText (map squirtWithError [-2, -1, 0, 16, 36]) | |
-- types | |
data Option a = None | Some a |
=begin | |
Pentagonal numbers are generated by the formula, Pn=n(3n−1)/2. The first ten pentagonal numbers are: | |
1, 5, 12, 22, 35, 51, 70, 92, 117, 145, ... | |
It can be seen that P^4 + P^7 = 22 + 70 = 92 = P^8. | |
However, their difference, 70 − 22 = 48, is not pentagonal. | |
Find a pair of pentagonal numbers P^j and P^k, |
class GuessTheNumber | |
def play | |
@nnn = 1.upto(100).to_a.sample | |
# play game | |
puts "Alright, I have a number in mind from 1-100. Pick a number." | |
guess = gets.chomp | |
puts "You said #{guess}." | |
attempt guess | |
end |
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, |
type Maybe a = Nothing | Just a | |
type Option a = None | Some a | |
type Result a = Failure | Success a | |
max [] ----> Failure | |
max [1,2,3] -----> Success 3 |
function sum (numbers) { | |
return !numbers.length ? 0 : numbers[0] + sum(numbers.slice(1)); | |
}; |
module Sinatra | |
module Kittens | |
module Helpers | |
def kittens_page(x = 200..500, factor = 0.2) | |
sample_method = RUBY_VERSION >= '1.9' ? :sample : :choice | |
x = x.to_a.send(sample_method) | |
y = ((x - factor*x).floor..(x + factor*x).ceil).to_a.send(sample_method) | |
<<-HTML | |
<!DOCTYPE html> |
import Text (asText) | |
type Collection a = Nada | Glue a (Collection a) | |
summm xs = | |
case xs of | |
Nada -> 0 | |
Glue face body -> face + (summm body) | |
listToCollection collection = |
Sae Rom Hong
Imagine a mythical forest. This is a forest that at first, exists only in the invisible nth-dimension of your imagination. Just like Peter Pan's Neverland. This forest is the world of the Linux/Unix command line, and everything is enshrouded in a thick, black, darkness. The only remnants of light glow and flicker between walls of forward slashes, glittering periods, and blinking cursors.
Deep inside the forest hides an elusive silver unicorn. The unicorn flits in and out, behind thick trunks of trees, a hint of a mane trailing in the darkness. You have heard a rumor that it is possible to catch a glimpse of this unicorn, if you use a little “magic”.