An implementation of Conway's Game of Life in 140 characters of Ruby.
Created by Simon Ernst (@sier).
An implementation of Conway's Game of Life in 140 characters of Ruby.
Created by Simon Ernst (@sier).
| /** | |
| * TV screen | |
| */ | |
| html { background: white; } | |
| .tv { | |
| position: relative; | |
| width: 200px; | |
| height: 150px; |
| (trace-source (let ((i (+ 4 5))) | |
| (+ i (* 2 (/ 3 4))))) | |
| ;; Output | |
| (let ((i (+ 4 5))) | |
| (+ i (* 2 (/ 3 4)))) | |
| -- (+ 4 5) | |
| >> RESULT: 9 |
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
Since this is on Hacker News and reddit...
_t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".char *s.type * name, however, is entirely intentional.| " About: | |
| " | |
| " How often do you forget which keys you should use to select/modify strings | |
| " in the ' or " or in other pairs? I often use viw/ciw instead of vi'/vi" for | |
| " the first time because it easier for my fingers (but after that I remember | |
| " about vi'). This script allows you always use the same shortcut for all | |
| " cases. When you want to select string in the ' use viv. Do you want to | |
| " select all in the '()'? Use viv. All in the '[]'? Use viv. | |
| " | |
| " How it works: |
| #!/bin/bash | |
| # From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/ | |
| # | |
| ARGS=2 | |
| E_BADARGS=99 | |
| if [ $# -ne $ARGS ] # correct number of arguments to the script; | |
| then |
| { | |
| {I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It | |
| is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as | |
| you did, the {internet|net|web} will be {much more|a lot more} | |
| useful than ever before.| | |
| I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!| | |
| {I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch} | |
| your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any? | |
| {Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe. | |
| Thanks.| |
| ; my incredibly ugly solution | |
| (fn rinter [s parts] | |
| (letfn [(mod-index [s n] (keep-indexed (fn [index item] [(rem index n) item]) s))] | |
| (map (fn [place] | |
| (reduce (fn [acc [index v]] | |
| (if (= index place) | |
| (conj acc v) | |
| acc)) | |
| [] |