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
| ## dgraph query | |
| { | |
| person(func: uid(0x41d)) { | |
| __typename | |
| uid | |
| name: Person.name | |
| partner: Person.partner { | |
| __typename | |
| uid | |
| name: Person.name |
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
| # Require Swiss File Knife (sfk) (available from homebrew on macOS) | |
| # find all files detected as CRLF and force CRLF | |
| find . -not -path "./.git*" -type f | xargs file | grep "CRLF" | awk -F ':' '{ print $1 }' | xargs sfk addcr | |
| # find all files detected as LF and force LF | |
| find . -not -path "./.git*" -type f | xargs file | grep -v "CRLF" | awk -F ':' '{ print $1 }' | xargs sfk remcr |
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
| function Buffer(a) { | |
| this.buffer = a; | |
| this.position = 0; | |
| } | |
| Buffer.prototype = { | |
| seek: function(a) { | |
| this.position = a; | |
| }, | |
| skip: function(a) { | |
| this.position += 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
| version: '3' | |
| services: | |
| data: | |
| image: dgraph/dgraph:master | |
| volumes: | |
| - dgraph:/dgraph | |
| zero: | |
| image: dgraph/dgraph:master | |
| command: dgraph zero --port_offset -2000 --my=zero:5080 |
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
| ///////////////////////////////////////////////////// TAKE 1 | |
| http://localhost:8080/mutate | |
| { set { | |
| _:node <__typename> "Person" . | |
| _:node <name> "Tim" . | |
| _:node <children> _:node0 . | |
| _:node0 <parents> _:node . | |
| _:node0 <__typename> "Person" . | |
| _:node0 <name> "Jerry" . |
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
| #!/bin/bash | |
| # install dgraph | |
| sudo apt-get update -y | |
| sudo apt-get install -y gcc | |
| curl https://get.dgraph.io -sSf | bash | |
| # create dgraph.service | |
| sudo bash -c 'cat << EOF > /etc/systemd/system/dgraph.service | |
| [Unit] |
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
| /* @flow */ | |
| type ErrorResponse = { | |
| code: 'Error', | |
| message: string | |
| } | |
| type ResultResponse = {} | |
| function test (): Promise<ResultResponse | ErrorResponse> { |
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 haxe; | |
| typedef Error = | |
| #if !native_error | |
| String; | |
| #elseif js | |
| js.Error; | |
| #elseif flash | |
| flash.errors.Error; | |
| #elseif java |
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 haxe.macro.Type; | |
| using haxe.macro.Tools; | |
| using Lambda; | |
| class Test | |
| { | |
| static function main() new Test(); | |
| function new() | |
| { |
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 Test | |
| { | |
| static function main() | |
| { | |
| try nativeException() catch (e:Dynamic) trace(haxe.CallStack.exceptionStack()); | |
| try haxeException() catch (e:Dynamic) trace(haxe.CallStack.exceptionStack()); | |
| } | |
| static function haxeException() throw 'error'; | |
| static function nativeException() sys.io.File.getContent('file-that-does-not-exist.txt'); |