This file contains 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
interface Node { | |
_id: ID! | |
} | |
type User implements Node { | |
_id: ID! | |
name: String | |
} | |
type Book implements Node { |
This file contains 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
type Query { | |
me: User | |
node(_id: ID!): Node | |
nodes(_ids: [ID!]!): [Node]! | |
} | |
type User implements Node { | |
id: ID! | |
name: String | |
books(first: Int, last: Int, before: String, after: String): BookConnection |
This file contains 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
type CreateBookPayload { | |
book: Book | |
} | |
type CreateMusicPayload { | |
music: Music | |
} | |
input CreateBookInput { | |
_id: ID! |
This file contains 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
type Book implements Node { | |
_id: ID! | |
name: String | |
authors: [User] | |
pages(first: Int, last: Int, before: String, after: String): PageConnection | |
} |
This file contains 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
// graphql definition for User | |
type User implements Node { | |
_id: ID | |
name: String | |
friends: [User] | |
} | |
// implement | |
import { Users} from '/imports/models' | |
class Node { | |
constructor(node) { |
This file contains 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
{ | |
"PT":1, | |
"TN":1, | |
"epsilon":1, | |
"ALPHA":1, | |
"BETA":1, | |
"GAMMA":1, | |
// apps property contains a list of applications. In this scenario, there is only one application | |
"apps":[ | |
// appIndex = 0 |
This file contains 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
pragma solidity ^0.4.24; | |
contract Victim { | |
// gasless send error | |
function withdraw0(uint n, address addr) payable { | |
require(address(addr).send(n)); | |
} | |
// reentrancy | |
function withdraw1(uint n) payable { | |
msg.sender.call.value(n)(); |
This file contains 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
pragma solidity ^0.4.2; | |
contract Attacker { | |
bytes data = ""; | |
uint count = 0; | |
address victim = 0xf1; | |
function() payable { | |
count ++; | |
if (count < 2) { |
This file contains 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
sudo apt-get install libleveldb-dev | |
find ../storage/ -printf "%T@ %Tc %p\n" | sort | head -100 | awk '{print $7}' | xargs cp -t . |
OlderNewer