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
zshrc () { | |
exec zsh -l | |
} | |
s () { | |
subl "$1" | |
} | |
cyberd () { |
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
#!/usr/bin/python | |
#-*-coding: utf-8 -*-\ | |
import sys | |
import codecs | |
import json | |
from collections import Counter | |
print ("@relation Spamster") | |
print () |
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
require('babel-polyfill'); | |
var fs = require('fs'); | |
var path = require('path'); | |
var webpack = require('webpack'); | |
var assetsPath = path.resolve(__dirname, '../static/dist'); | |
var host = (process.env.HOST || 'localhost'); | |
var port = (+process.env.PORT + 1) || 3001; | |
var WebpackIsomorphicToolsPlugin = require('webpack-isomorphic-tools/plugin'); |
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
#include"cstdio" | |
#include"iostream" | |
using namespace std; | |
# define N 1001 | |
int day[N][N] = {0}, minute[N][N] = {0}; | |
void print(int n) { | |
for (int i = 0; i <= n; i++) { | |
for (int j = 0; j <= n; j++) { |
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
function: Deposit | |
parameters: Amount, Deadline | |
code: | |
- Check if function Caller transfer asset to this contract by at least the Amount. | |
- if not, reject transaction | |
- Increase function Caller's balance by Amount. | |
- Lock this chunk of asset with the deadline. | |
function: Withdraw | |
parameters: Amount |
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
//SPDX-License-Identifier: Unlicense | |
pragma solidity ^0.8.0; | |
import "hardhat/console.sol"; | |
contract LoveLetter { | |
uint256 public totalLetters; | |
mapping(uint256 => address) public senders; | |
mapping(uint256 => address) public receivers; | |
struct Letter { |
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
//SPDX-License-Identifier: Unlicense | |
pragma solidity ^0.8.0; | |
import "hardhat/console.sol"; | |
contract LoveLetter { | |
uint256 public totalLetters; | |
mapping(uint256 => address) public senders; | |
mapping(uint256 => address) public receivers; | |
struct Letter { |
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
contract LoveLetter { | |
... | |
function send(address to, string memory message) | |
external | |
payable | |
returns (uint256 id) | |
{ | |
id = totalLetters; | |
senders[id] = msg.sender; |
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
contract LoveLetter { | |
... | |
function open(uint256 id) external returns (string memory message) { | |
require(receivers[id] == msg.sender, "Not receiver"); | |
require(!letters[id].opened, "Already opened"); | |
message = letters[id].message; | |
letters[id].opened = true; | |
uint256 amount = letters[id].etherAmount; | |
console.log("[open]", id, amount); |
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
contract LoveLetter { | |
... | |
function readMessage(uint256 id) | |
external | |
view | |
returns (string memory message) | |
{ | |
message = letters[id].message; | |
} |
OlderNewer