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
set :application, "abc" | |
set :repository, "git://github.com/gaagaaga/abcde.git" | |
set :scm, :git | |
set :user, 'deploy' | |
set :use_sudo, false | |
set :deploy_to, "/home/deploy/rapp/abc" | |
set :deploy_via, :remote_cache |
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
type MockIO = State MockIOData | |
instance CharIO MockIO where | |
getCh = do | |
d <- get | |
case d of | |
MockIOData (i:is) o -> do | |
put $ MockIOData is o | |
return $ Just i | |
MockIOData [] _ -> |
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
import Control.Monad.State | |
type IntState = State Int | |
inc :: IntState () | |
inc = do | |
v <- get | |
put (v + 1) | |
twice :: IntState () |
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
data BFState = BFState { | |
dataLeft :: [Word8], | |
dataRight :: [Word8], | |
codeLeft :: [Char], | |
codeRight :: [Char], | |
bfOutput :: [Char] | |
} | |
fwdCode, backCode :: State BFState () | |
fwdCode = modify $ \s@(BFState{codeLeft=ls, codeRight=r:rs}) -> s{codeLeft=r:ls, codeRight=rs} |
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
import Control.Monad.State | |
import Data.Word(Word8) | |
import Data.Char(chr) | |
data BFState = BFState { | |
dataLeft :: [Word8], | |
dataRight :: [Word8], | |
codeLeft :: [Char], | |
codeRight :: [Char], | |
bfOutput :: [Char] |
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
import Data.Word(Word8) | |
import Data.Char(chr) | |
data BFData = BFData { | |
curr :: Word8, | |
left :: [Word8], | |
right :: [Word8] | |
} deriving(Show) | |
data BFState = BFState { |
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 Tester | |
def +(v) # OK | |
end | |
def abc=(v) # OK | |
end | |
def +=(v) # Syntax Error | |
end | |
end |
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
xcopy /s /y /k C:\RamDiskImg\*.* R:\ |
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
set ramDiskImgDir=C:\RamDiskImg | |
md %ramDiskImgDir%\ChromeUserData | |
xcopy /s /y /k "R:\ChromeUserData\Local State" %ramDiskImgDir%\ChromeUserData\ | |
xcopy /y /k R:\ChromeUserData\Default\*.* %ramDiskImgDir%\ChromeUserData\Default\ | |
xcopy /s /y /k "R:\ChromeUserData\Default\Plugin Data\*.*" "%ramDiskImgDir%\ChromeUserData\Default\Plugin Data\" |
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
-module(tcp_bridge). | |
-export([start/3]). | |
start(IP, Port, LocalPort) -> | |
{ok, ListenSocket} = gen_tcp:listen( LocalPort, [list, inet, {packet, raw}] ), | |
spawn( fun() -> listen_loop(ListenSocket, IP, Port) end ). | |
listen_loop(ListenSocket, IP, Port) -> | |
{ok, LocalSocket} = gen_tcp:accept(ListenSocket), | |
{ok, RemoteSocket} = gen_tcp:connect(IP, Port, [list, inet, {packet, raw}], 3000), |