Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 (c) | |
c.floating = true | |
local geo = {} | |
geo.x = screen[1].geometry.x | |
geo.y = screen[1].geometry.y | |
geo.width = screen[1].geometry.width | |
geo.height = screen[1].geometry.height | |
geo.x2 = geo.x + geo.width | |
geo.y2 = geo.y + geo.height | |
for s in screen do |
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
use std::net::Shutdown; | |
use std::os::unix::net::UnixDatagram; | |
use std::{sync::Arc, thread}; | |
use Shutdown::Both; | |
fn main() -> std::io::Result<()> { | |
let sock = Arc::new(UnixDatagram::bind("./my-unix-socket")?); | |
let mut buf = vec![0; 10]; | |
let builder = thread::Builder::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
use std::net::Shutdown; | |
use std::os::unix::net::UnixDatagram; | |
use std::{sync::Arc, thread}; | |
fn main() -> std::io::Result<()> { | |
let sock = Arc::new(UnixDatagram::bind("./my-unix-socket")?); | |
let mut buf = vec![0; 10]; | |
let builder = thread::Builder::new() | |
.name("foo".into()) |
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
fn sendPacket(packet: Packet) { | |
... | |
let latestClient = provableStore.get(clientPath(connection.clientIdentifier)); | |
let latestHeight = latestClient.height; | |
... | |
} |
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 is pseudo-code of downloading a snapshot. | |
roots <- set { state_root } | |
while let Some(root) = roots.pop_any() { | |
c = download_chunk(root); | |
assert root == merklize(c) | |
store(c) | |
roots.insert(all children of terminal Branches in c) | |
} |
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
const encoder = new TextEncoder(); | |
const decoder = new TextDecoder("utf-8"); | |
const simplePat = /Copyright (201[0-9]) Kodebox/g; | |
const complexPat = /Copyright (\d+)-(\d+) Kodebox/g; | |
for (let i = 1; i < Deno.args.length; i++) { | |
let filename = Deno.args[i]; | |
if (!await isFileExist(filename)) { | |
continue; | |
} |
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": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "sequelize-cli-manual", | |
"program": "${workspaceFolder}/node_modules/sequelize-cli/lib/sequelize" | |
} | |
] |
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 { SDK } from "codechain-sdk"; | |
// Change platformAddress | |
const platformAddress = "wccq9ma52hnvy3fsalpavqazu3qxptfemj8zgtj4gk5"; | |
// Change assetAddress | |
const assetAddress = "wcaqyq5mag5kp8v5exfx66mdph5drjjanlwlv6qzv9tlw"; | |
const passphrase = ""; | |
async function main() { | |
const sdk = new SDK({ |
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 { SDK } from "codechain-sdk"; | |
const fromPlatformAddress = "wccq9ma52hnvy3fsalpavqazu3qxptfemj8zgtj4gk5"; | |
const toPlatformAddress = "wccq9ma52hnvy3fsalpavqazu3qxptfemj8zgtj4gk5"; | |
const passphrase = ""; | |
async function main() { | |
const sdk = new SDK({ | |
server: "https://corgi-rpc.codechain.io", | |
networkId: "wc", |
NewerOlder