This file contains hidden or 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
FROM ubuntu | |
RUN apt update | |
RUN apt install -y libmysqlclient-dev gcc rsync |
This file contains hidden or 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
root@2aaacf161943:/wd/app# stack ghc -- -XTemplateHaskell -XRecordWildCards -XNoImplicitPrelude -XMultiParamTypeClasses -XOverloadedStrings -XFlexibleContexts -ddump-splices Model/Tweet.hs | |
[1 of 5] Compiling DataSource ( DataSource.hs, DataSource.o ) | |
[2 of 5] Compiling Model.Table.Tweet ( Model/Table/Tweet.hs, Model/Table/Tweet.o ) | |
Model/Table/Tweet.hs:12:3-21: Splicing declarations | |
defineTable "tweet" | |
======> | |
data Tweet | |
= Tweet {id :: !Int64, | |
accountId :: !Int64, | |
userId :: !Int64, |
This file contains hidden or 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
private static string Normalize(string path) | |
{ | |
// Example: path = "///1/..//../2/3/" | |
var trimed = path.Trim(new char[]{ Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }); // "1/..//../2//3" | |
Console.WriteLine("trimed: " + trimed); | |
var maxDep = 1 + trimed.Count(c => c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar); // 6 | |
Console.WriteLine("maxDep: " + maxDep); | |
var tmpParentPath = ""; // will be "a/a/a/a/a/a/" | |
for (var i = 0; i < maxDep; i++) | |
tmpParentPath = Path.Combine(tmpParentPath, "a"); |
This file contains hidden or 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
-- This is not OK. | |
module MainNG where | |
import Prelude (Unit) | |
import Control.Monad.Eff (Eff) | |
import Control.Monad.Eff.Console (CONSOLE, log) | |
main :: forall eff. Eff (console :: CONSOLE | eff) Unit | |
main = log "Hi" |
This file contains hidden or 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
Using a sandbox located at ~/Programming/Yi/.cabal-sandbox | |
/usr/bin/gcc -dumpversion | |
/usr/local/bin/haddock --version | |
/usr/local/bin/hpc version | |
looking for tool hsc2hs near compiler in /usr/local/bin | |
found hsc2hs in /usr/local/bin/hsc2hs | |
/usr/local/bin/hsc2hs --version | |
/usr/local/bin/ghc -c /var/folders/l0/lpt_nm052wx3k1_skr95lksh0000gq/T/56410.c -o /var/folders/l0/lpt_nm052wx3k1_skr95lksh0000gq/T/56410.o | |
/usr/local/Library/ENV/4.3/ld -x -r /var/folders/l0/lpt_nm052wx3k1_skr95lksh0000gq/T/56410.o -o /var/folders/l0/lpt_nm052wx3k1_skr95lksh0000gq/T/56411.o | |
/usr/local/bin/pkg-config --version |
This file contains hidden or 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
\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\[\e[36m\]$(__git_ps1 " %s")\[\e[0m\]\n\$ |
This file contains hidden or 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
// Rust 0.7 | |
enum Term { | |
True, False, Zero, | |
Succ(@Term), Pred(@Term), IsZero(@Term), | |
If(@Term, @Term, @Term) | |
} | |
enum Value { | |
VTrue, VFalse, NV(@NumberValue) |
This file contains hidden or 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
enum A { | |
A(B) | |
} | |
enum B { | |
B1, B2(B) | |
} | |
fn main() { | |
} |
This file contains hidden or 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
// ! incomplete | |
package main | |
import ( | |
"fmt" | |
"math/cmplx" | |
) | |
func Cbrt(x complex128) complex128 { | |
var z complex128 = 1 |
This file contains hidden or 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
package main | |
import "fmt" | |
// fibonacci is a function that returns | |
// a function that returns an int. | |
func fibonacci() func() int { | |
a, b := 1, 1 | |
return func() int { | |
tmp := a |