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
use std::env; | |
use std::fs::read_dir; | |
use std::path::PathBuf; | |
use std::process::Command; | |
fn diffbelt_example_wasm_build_rs() { | |
let manifest_dir = env::var("CARGO_MANIFEST_DIR").expect("No CARGO_MANIFEST_DIR var"); | |
let mut wasm_crate_path = PathBuf::from(manifest_dir); |
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/env node | |
const child_process = require('child_process'); | |
const texts = process.argv.slice(2); | |
(async () => { | |
const commandsDef = texts.map((text, index) => { | |
const isFirst = index === 0; | |
const isLast = index === texts.length - 1; |
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
#!/bin/bash | |
IMAGE_NAME="ubuntu-with-sshd" | |
CONTAINER_NAME="ubuntu-with-sshd" | |
SSH_PORT=9022 | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | |
if [[ "$(docker images -q $IMAGE_NAME 2> /dev/null)" == "" ]]; then | |
cat > $DIR/Dockerfile <<- EOM | |
FROM ubuntu:22.04 |
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
import reapy | |
import sys | |
import serial | |
# Initialize Reaper API | |
project = reapy.Project() | |
mic_track = None | |
for track in project.tracks: | |
if track.name == "mic": |
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
#define PIN_PEDAL_ANALOG A0 | |
#define PIN_LED 8 | |
#define MIN_LEVEL 590 | |
#define MAX_LEVEL 620 | |
bool pedalEnabled = false; | |
void setup() { | |
pinMode(PIN_LED, OUTPUT); |
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
local bit = require "bit" | |
local _M = {} | |
local maxInt = 2147483647 | |
local base = 36 | |
local tMin = 1 | |
local tMax = 26 | |
local skew = 38 | |
local damp = 700 |
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
export { Xoroshiro128Plus }; | |
function Xoroshiro128Plus(options) { | |
let { state } = options || {}; | |
if (!state) { | |
let time = (Date.now() | 0) >>> 0; | |
state = [ | |
(time & ((Math.random() * 0xffffffff) | 0)) >>> 0, | |
(time & ((Math.random() * 0xffffffff) | 0)) >>> 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
let playButton = document.createElement('button'); | |
playButton.textContent = 'Play'; | |
document.body.appendChild(playButton); | |
playButton.addEventListener('click', () => { | |
let audioCtx = new AudioContext(); | |
let sampleRate = audioCtx.sampleRate; | |
let totalSeconds = 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
const wialon = require('./wialon.node.js').wialon; | |
// Print message to log | |
function msg(text) { console.log(text); } | |
function init() { // Execute after login succeed | |
var sess = wialon.core.Session.getInstance(); // get instance of current Session | |
// flags to specify what kind of data should be returned | |
var flags = wialon.item.Item.dataFlag.base | wialon.item.Unit.dataFlag.lastMessage; |
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(){ | |
const IGNORE_URLS = [ | |
/^\/..\/blog/, | |
]; | |
const TIMEOUT = 30000; | |
let framesPool = new Pool({ | |
maxCount: 4, | |
maxCountForSlow: 8, |
NewerOlder