This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/work % curl -O https://distfiles.macports.org/MacPorts/MacPorts-2.0.1.tar.bz2 (1) | |
~/work % bzip2 -cd MacPorts-2.0.1.tar.bz2 | tar xf - (2) | |
~/work/MacPorts-2.0.1 % CC=/Developer/usr/bin/llvm-gcc PATH=/sbin:/usr/sbin:$PATH ./configure --prefix=/opt/macports (3) | |
~/work/MacPorts-2.0.1 % nice -20 make -j4 (4) | |
~/work/MacPorts-2.0.1 % sudo make install (5) | |
~/work/MacPorts-2.0.1 % id macports | cut -d ' ' -f 1-2 (6) | |
uid=504(macports) gid=503(macports) | |
~/work/MacPorts-2.0.1 % alias sport (7) | |
sport='sudo CC=/Developer/usr/bin/llvm-gcc CXX=/Developer/usr/bin/llvm-g++ TMPDIR=/opt/tmp port' | |
~/work/MacPorts-2.0.1 % sport selfupdate (8) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mazda := Object clone | |
Mazda cry := method("Zoom-Zoom" println) | |
Mazda getSlot("cry") call |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 | |
PortSystem 1.0 | |
PortGroup cmake 1.0 | |
name yajl1 | |
version 1.0.12 | |
categories devel | |
maintainers gmail.com:passingloop | |
description Yet Another JSON Library. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
book({"Author" : "Tate"}, | |
ul( | |
li("Io"), | |
li("Lua"), | |
li("JavaScript") | |
) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% -*- mode: prolog; -*- | |
fact(1, 0). | |
fact(F, N) :- | |
N > 0, | |
N1 is N - 1, | |
fact(F1, N1), | |
F is F1 * N. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Board(board: List[Char]) { | |
val lines = List( | |
(0, 1, 2), (3, 4, 5), (6, 7, 8), | |
(0, 3, 6), (1, 4, 7), (2, 5, 8), | |
(0, 4, 8), (2, 4, 6) | |
) | |
var winner = ' ' | |
def showWinner { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# W | |
# R RW W. | |
# RW::::RW DR::R | |
# :RRRRRWWWWRt:::::::RRR::::::E jR | |
# R.::::::::::::::::::::::::::Ri jiR:::R | |
# R:::::::.RERRRRWWRERR,::::::Efi:::::::R GjRRR Rj | |
# R::::::.R R:::::::::::::;G RRj WWR RjRRRRj | |
# Rt::::WR RRWR R::::::::::::::::fWR::R; WRW RW R | |
# WWWWRR:::EWR E::W WRRW:::EWRRR::::::::: RRED WR RRW RR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>cx.pow.firewall</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>sh</string> | |
<string>-c</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Censor { | |
val document: List[String] | |
val dictionary = Map("Shoot" -> "Pucky", "Darn" -> "Beans") | |
def censor = document.map(word => dictionary.getOrElse(word, word)) | |
} | |
object sample extends Censor { | |
val document = List("Gosh", "Darn", "It", "Shit", "Shoot") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- sizer.scala 2011-09-28 12:54:10.000000000 +0900 | |
+++ my_sizer.scala 2011-09-28 12:54:47.000000000 +0900 | |
@@ -5,5 +5,10 @@ | |
// START:loader | |
object PageLoader { | |
- def getPageSize(url : String) = Source.fromURL(url).mkString.length | |
+ val reg = """<a [^>]*>[^<]+</a>""".r | |
+ | |
+ def getPageSize(url : String) = { | |
+ val page = Source.fromURL(url).mkString |
OlderNewer