Skip to content

Instantly share code, notes, and snippets.

@adeonhy
adeonhy / gist:9c90c5bcf34b796ce7d3d2869f58a4e7
Created October 7, 2018 09:39
ファームウェアパッケージ書き込み時エラー
[hy@hyPro]% sudo nrfutil dfu usb-serial -pkg ble_master.zip -p /dev/tty.usbmodem14125
Password:
Traceback (most recent call last):
File "/usr/local/bin/nrfutil", line 11, in <module>
sys.exit(cli())
File "/Library/Python/2.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/Library/Python/2.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
@adeonhy
adeonhy / 40_percent_emulation.json
Created December 14, 2018 04:07
karabiner-elementsで40%キーボードみたいにqwerty行で記号入力(space押しながらで入力) ※SpaceFNのパクリ
{
"title": "40percent",
"rules": [
{
"description": "add new layer(Space+?)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "spacebar",
@adeonhy
adeonhy / index.elm
Created June 19, 2019 07:02
ねた
module Main exposing (Model, Msg(..), init, main, update, view)
import Browser
import Html exposing (Html, button, div, input, p, text)
import Html.Attributes exposing (class, href, placeholder, src, style, type_)
import Html.Events exposing (onClick, onInput)
import Time exposing (Posix, Zone, utc)
#!/bin/sh
printf "Detecting USB port, reset your controller now."
ls /dev/tty* > /tmp/1
while [ -z $USB ]; do
sleep 0.5
printf "."
ls /dev/tty* > /tmp/2
USB=`comm -13 /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`
mv /tmp/2 /tmp/1
type square =
| Blank
| O
| X;
let stringOfSquare = square =>
switch (square) {
| Blank => "b"
| O => "o"
| X => "x"
@adeonhy
adeonhy / crypter.js
Created September 23, 2020 07:54
うまく動かなかったやつ
const fs = require('fs')
const crypto = require('crypto')
const readline = require('readline');
const ALGORITHM = 'aes-256-cbc';
// main
// node crypter.js [enc/dec] [in filename] [out filename]
(async () => {
const args = process.argv.slice(2);
async fn get_command_type(msg: &Message) -> (CommandTypeId,u8){
let command_str = &msg.content;
if let Ok(n) = scan_fmt(command_str, "!ひよこスロット*{d}", u8) {
if n >= 10 {
return (CommandTypeId::HiyokoSlot,1);
} else {
return (CommandTypeId::HiyokoSlot,n);
}
} else if command_str.starts_with("!ひよこスロット") {
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
use yew::prelude::*;
use yew::services::console::ConsoleService;
use yew::web_sys::KeyboardEvent;
mod constants;
struct Model {
key: String,
link: ComponentLink<Self>,
use serde::Deserialize;
use wasm_bindgen::prelude::*;
use yew::prelude::*;
use yew::services::console::ConsoleService;
use yew::services::fetch::{FetchService, FetchTask, Request, Response};
use yew::services::keyboard::{KeyListenerHandle, KeyboardService};
use yew::web_sys::KeyboardEvent;
use yew::{
format::{Json, Nothing},
prelude::*,
hsgw is Awesome
hsgw is Awesome
しずかなhsgw
hsgw is Awesome
こはんのhsgw
しずかなhsgw
うるせえhsgw
hsgw is Awesome
しずかなhsgw
こはんのhsgw