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
@echo off | |
SET st2Path=C:\Program Files\Sublime Text 2\sublime_text.exe | |
rem add it for all file types | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f | |
rem add it for folders | |
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import scala.collection.AbstractIterator | |
import scala.collection.Iterator | |
object UniqueBy extends App { | |
val lines = io.Source.fromFile("""somefile""").getLines | |
uniqueBy(lines)(_.trim.headOption.getOrElse("")).foreach(println) | |
def uniqueBy[T, U](it: Iterator[T])(pred: T => U) = new AbstractIterator[T] { |
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
//Values and definitions | |
val x = 5 // constant, evaluated once | |
def y = 5 // definition (function), evaluated at each call | |
lazy val z = 5 // constant with lazy evaluation | |
var v = 5 // variable, only use when really needed | |
//Control constructs | |
if (true) 1 else 2 // conditional _expression_, of type Int |
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
Host * | |
ServerAliveInterval 60 | |
StrictHostKeyChecking no | |
Host dockercobai | |
Hostname oscobai064s | |
ProxyCommand ssh -W %h:%p bastion | |
ForwardAgent yes | |
User www | |
IdentityFile "/c/Utilisateurs/a518291/.ssh/id_rsa_bastion" |
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
class BowlingGame { | |
var moves = Vector.empty[Int] | |
def roll(i: Int) = { | |
moves = moves :+ i | |
} | |
def score: Int = score() |
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
#inspired by http://unix.stackexchange.com/questions/4367/extracting-nested-zip-files | |
while [ "`find . -type f -name '*.?ar' | wc -l`" -gt 0 ]; do 1 ↵ | |
find . -type f -name "*.?ar" \ | |
-exec mkdir -p '{}.dir' \; \ | |
-exec echo "unzipping "{}" to "{}".dir" \; \ | |
-exec unzip -o -d '{}.dir' -- '{}' \; \ | |
-exec rm -- '{}' \;; | |
done |
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 jm.desprez.bucketproblem; | |
import javaslang.Function1; | |
import javaslang.collection.LinkedHashSet; | |
import javaslang.collection.List; | |
import javaslang.collection.Set; | |
import javaslang.collection.Stream; | |
import javaslang.control.Option; | |
import lombok.AllArgsConstructor; | |
import lombok.Data; |
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
import rapture.json._ | |
import rapture.json.jsonBackends.jackson._ | |
import rapture._ | |
object JsonDemo extends App { | |
val p1 = Person("toto", List(Address("du chat", 3, "Lille")), None) | |
val p2 = Person("titi", List(Address("du chien", 2, "Lille")), Some("maid")) | |
val jsonStr = Json(List(p1, p2)).toString | |
println(jsonStr) |
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
log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %Cblue<%an>%Creset' --abbrev-commit --date=relative --all | |
git log --pretty=format:"[%h] %an %ad %s" --numstat --date=short | |
git log --pretty=format:"[%h] %an %ad %s" --numstat --date=short --follow FILENAME | |
rem get all commits ids from auser, from all branches | |
git log --pretty=format:"%H" --author=auser --all | |
rem diff at character level instead of line |