Looking at projects that are good candidates for being re-written in rust / webassembly!
https://www.npmjs.com/package/moment-timezone
could build off work in rust: https://github.com/chronotope/chrono
import subprocess as sp | |
import pyautogui | |
import time | |
child = sp.Popen(["write.exe"]) | |
time.sleep(1) | |
pyautogui.typewrite('Dae Choi is the best.\nGive me a job!', interval=0.1) | |
# Save |
use std::{env, fs, process}; | |
use std::error::Error; | |
use std::convert::{TryFrom,TryInto}; | |
use std::io::{Write,BufWriter}; | |
static HELP_TEXT: &str = "ico-join [<PNG>...] <DEST> | |
<PNG> Path to png files you want to combine. | |
<DEST> Path to the output file. | |
"; |
const fs = require("fs"); | |
const path = require("path"); | |
const glob = require("glob"); | |
const async = require("async"); | |
const zlib = require("zlib"); | |
function gzipFile(src, callback) { | |
console.log(`Compressing ${src}`); | |
const dst = `${src}.gz`; | |
fs.createReadStream(src) |
Looking at projects that are good candidates for being re-written in rust / webassembly!
https://www.npmjs.com/package/moment-timezone
could build off work in rust: https://github.com/chronotope/chrono
// PromiseState provides primitives for representing a promise's "state" as a | |
// value. | |
// | |
// That's kinda abstract so let's think through it. At any given point in time | |
// a promise is either pending, resolved, or rejected. There's no real | |
// synchronous way to access this promise "state", promises only give us `then` | |
// and callbacks. | |
// | |
// In react we usually care about rendering _all_ of these possible states. For | |
// example, we want to show a spinner when it's loading, the results when it |
package batchchan | |
import "github.com/cheekybits/genny/generic" | |
import ( | |
"fmt" | |
) | |
type T generic.Type |
const fs = require("fs"); | |
const crypto = require("crypto"); | |
const spawnSync = require("child_process").spawnSync; | |
// Load the environment using the same code react-scripts uses. | |
process.env.NODE_ENV = "production"; | |
const clientEnv = require("react-scripts/config/env")().raw; | |
const REACT_APP_RUNTIME = /^REACT_APP_RUNTIME_/i; |
function genSelectorType({ count, isParametric, isArraySelector }) { | |
const rmap = fn => { | |
const results = []; | |
for (let i = 2; i <= count; i++) { | |
results.push(fn(i)); | |
} | |
return results; | |
}; |
// Package sqlmap provides functions for querying directly into | |
// map[string]interface{}. | |
// | |
// In developing really simple api endpoints, I found the boilerplate needed | |
// to take the results of a database query and output them as JSON to be | |
// really fucking annoying; make a custom struct, scan into that struct, if | |
// there are multiple rows do the whole rows.Next() song and dance, and if | |
// anything changes update the three spots each column of the result is now | |
// dependent on. Even when using libraries like sqlx, there's still a lot of | |
// extraneous code that needs to be written. |
#!/usr/bin/env python | |
# This script signs github for desktop powershell scripts. | |
# | |
# Powershell scripts are locked down here (via sysadmin decree), but the GitHub | |
# Desktop app uses powershell scripts when you right click > "Open in Git | |
# Shell". This is pretty much a requirement since the application can only | |
# handle fairly simple git operations. | |
# | |
# In order for these scripts to work they need to be signed. I don't remember |