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 MagicList[A](val value:List[A]) { | |
| def ~(i:A) = new MagicList(this.value :+ i) | |
| } | |
| object MagicList { | |
| implicit def toMagicList[A](t: A): MagicList[A] = new MagicList[A](List(t)) | |
| implicit def fromMagicList[A](magicList: MagicList[A]): List[A] = magicList.value | |
| } | |
| import MagicList._ |
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 MagicList[A](val value:List[A]) { | |
| def ~(i:A) = new MagicList(this.value :+ i) | |
| } | |
| object MagicList { | |
| implicit def toMagicList[A](t: A): MagicList[A] = new MagicList[A](List(t)) | |
| implicit def fromMagicList[A](magicList: MagicList[A]): List[A] = magicList.value | |
| } | |
| import MagicList._ |
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 class will define conversions to currencies. Type can be BigDecimal as well. | |
| implicit class MoneyConversions(amount: Double) extends AnyVal { | |
| def usd = USD(amount) | |
| def euro = EUR(amount) | |
| def try = TRY(amount) | |
| } | |
| sealed trait Money { | |
| // we can define custom precision for instance. | |
| def +(other: this.type) =... | |
| ... // custom methods |
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
| #git flow brachlar arası hızlı geçiş | |
| function co () { | |
| branch=`git branch | grep $1` | |
| if [ "${branch:0:1}" = "*" ] | |
| then | |
| echo "already on ${branch:1}" | |
| else | |
| command git checkout $branch; | |
| fi | |
| } |
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
| */1 * * * * amixer set Master 100 unmute |
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 socket | |
| import sys | |
| from sets import Set | |
| old_server_address = ('localhost', 9998) # eski server | |
| new_server_address = ('localhost', 9999) # yeni server | |
| def main(): | |
| f = open("input") | |
| wOld = open("outputEski","w") #eski server | |
| wNew = open("output","w") #yeni server |