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
| { pkgs ? import <nixpkgs> { } }: | |
| let | |
| ethMinerScript = pkgs.writeScriptBin "start" '' | |
| ethminer --farm-recheck 200 --cuda --pool stratum1+tcp://<ETH_ADDRESS>.<ETH_MINER_TAG>@eu1.ethermine.org:4444 | |
| ''; | |
| in | |
| pkgs.mkShell { | |
| buildInputs = with pkgs; [ | |
| ethminer |
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
| { pkgs ? import <nixpkgs> { } }: | |
| let | |
| replScript = pkgs.writeScriptBin "repl" '' | |
| ghci | |
| ''; | |
| in | |
| pkgs.mkShell { | |
| buildInputs = [ | |
| pkgs.haskellPackages.ghc |
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
| parted /dev/sda -- mklabel msdos | |
| parted /dev/sda -- mkpart primary 1MiB -4GiB | |
| parted /dev/sda -- mkpart primary linux-swap -4GiB 100% |
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
| { mkDerivation, aeson, base, bytestring, http-types, lucid, mtl | |
| , servant, servant-docs, servant-server, stdenv, text, wai | |
| , wai-extra | |
| }: | |
| mkDerivation { | |
| pname = "my-app"; | |
| version = "1.0.0.0"; | |
| src = ./.; | |
| isLibrary = true; | |
| isExecutable = true; |
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
| let | |
| config = { | |
| packageOverrides = pkgs: rec { | |
| haskellPackages = pkgs.haskellPackages.override { | |
| overrides = haskellPackagesNew: haskellPackagesOld: rec { | |
| myApp = | |
| haskellPackagesNew.callCabal2nix "my-app" (./.) { }; | |
| }; | |
| }; | |
| }; |
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
| object JsFunctions { | |
| // Some more code here, using the buildServiceFunctions method | |
| def buildServerFunctions(name: String, funcs: List[RoundTripInfo], session: Box[LiftSession]): JsCmd = { | |
| JsRaw("""lift_serverFunctions().apply('%s', %s)""" | |
| .format(name, session.getOrElse(throw new Exception("Session required")).buildRoundtrip(funcs).toJsCmd).stripMargin).cmd | |
| } |
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 OrientIndexHandler(graph: OrientGraph) extends IndexHandler { | |
| override def createUniqueIndexField[ModelType, FieldType](field: Field[ModelType, FieldType], label: String): Unit = { | |
| val keyName = field.name | |
| val indexName = s"idx${label}_$keyName" | |
| val vertexType = graph.getVertexType(label) | |
| if (!vertexType.existsProperty(keyName)) { | |
| field match { |
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 demo.js | |
| import net.liftweb.http.js.JsCmd | |
| object JsCommands30 { | |
| /** | |
| * JsSchedule the execution of the JsCmd using setTimeout() | |
| * @param what the code to execute | |
| */ |
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 SampleControllerBackend extends StatefulSnippet with Logger { | |
| protected lazy val controllerId = Helpers.nextFuncName | |
| def dispatch = { | |
| case "serverFunctions" => serverFunctions _ | |
| case "allowModule" => allowModule _ | |
| } | |
| def allowModule(xhtml: NodeSeq): NodeSeq = { |
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 MySpec extends Specification { | |
| "OrientGraph Repository" should { | |
| "create 15 relationships properly" in { | |
| val db = OGraphDatabasePool.global() | |
| .acquire("remote:127.0.0.1/db", "admin", "admin") | |
| val clazz = db.getVertexType("TARGET_VERTEX") | |
| if (clazz == null) { |