Skip to content

Instantly share code, notes, and snippets.

View cho45's full-sized avatar

Satoh, Hiroh cho45

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env ruby
require "hid_api" # gem install hid_api
require "pp"
COMMAND_READ_ALL = 0xf2
COMMAND_VERSION = 0xf9
COMMAND_READ_COUNTER = 0xe3
COMMAND_INITIAL_CALIB = 0xdb
COMMAND_PRESS_CALIB = 0xdd
#COMMAND_WRITE_ALL = 0x00
#!/usr/bin/env ruby
require 'pp'
D = Struct.new(:sec, :size, :name)
target = ARGV.shift
sram = `arm-none-eabi-objdump -t '#{target}'`.chomp.split(/\n/).
select {|l| /\.(bss|data)|vectors/ =~ l }.
#!/usr/bin/perl -w
# avstack.pl: AVR stack checker
# Copyright (C) 2013 Daniel Beer <dlbeer@gmail.com>
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all
# copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
class SignalProcessor extends AudioWorkletProcessor {
constructor() {
super();
this.buffers = [];
this.port.onmessage = (e) => {
console.log(e, this.buffers);
this.port.postMessage(this.buffers);
// this.buffers.length = 0;
};
}
let a = 0;
for (let i = 0; i < 10000; i++) {
a += Math.sin(i);
a += Math.cos(i);
}
let n = 1e-320;
for (let i = 0; i < 100000; i++) {
n = n + 1e-320;
}
n = 1e-320;
for (let i = 0; i < 100000; i++) {
n = n - 1e-320;
}
@cho45
cho45 / machinekit.cps
Created September 27, 2016 16:51
Fusion 360 Custom Post Process Script supporting G64 P (tolerance option) for Machinekit
/**
* Modifled by cho45 for tolerance support
*
*
Original Copyright:
Copyright (C) 2012-2015 by Autodesk, Inc.
All rights reserved.
LinuxCNC (EMC2) post processor configuration.
@cho45
cho45 / tass.js
Created February 23, 2012 04:31
TASS is Tiny SCSS
#!node
function TASS (c) {
var mixins = {};
c = c.replace(/^@mixin\s+([\w\-]+)\s*\{([\s\S]*?)^\}/gm, function (_, name, content) {
mixins[name] = content;
return '';
});
c = c.replace(/@include \s*([\w\-]+)\s*;/g, function (_, name) {
#!./run.sh
--[[
Prometheus exporter for RTX1200
lua /rtx1200_exporter.lua
show status lua
]]
-- vim:fenc=cp932