Skip to content

Instantly share code, notes, and snippets.

View espresso3389's full-sized avatar

Takashi Kawasaki espresso3389

View GitHub Profile
void main() {
print('''Multiline
String
can be
directly embedded on the code!''');
}

M5Stack Motor Module/Cable

PIN Cable Color RJ12 PIN Description
M+ Black 2 motor +
G Green 4 encoder Vcc (3.3V - 5V)
A Yellow 5 encoder A
B Blue 6 encoder B
V Red 3 encoder GND
1 White 1 motor -
@espresso3389
espresso3389 / mobileprovision.sh
Last active December 25, 2020 09:32
Installing provisioning profile
#/bin/sh
#
# Installing provisioning profile
# Set $PROVISIONING_PROFILE_BASE64 and $CERT_SERIAL_NUMBER before invoking the script.
PROVPROF_TMP=$GITHUB_WORKSPACE/tmp.mobileprovision
echo "$PROVISIONING_PROFILE_BASE64" | openssl base64 -d -A -out $PROVPROF_TMP
UUID=`grep UUID -A1 -a $PROVPROF_TMP | grep -io "[-A-Z0-9]\{36\}"`
echo "Provisioning profile UUID: $UUID"
@espresso3389
espresso3389 / keychain_init.sh
Created December 1, 2020 14:39
Installing p12 certificate (public-key/private-key combination) to keychain accessible on ssh connection
#!/bin/sh
#
# Install our provisioning certificates on the runner machine
#
# Reference: https://apple.stackexchange.com/a/285320
#
# Set $P12_BASE64 and $P12_PASSWORD before invoking the script
MY_KEYCHAIN="temp.keychain"
@espresso3389
espresso3389 / vscode-disable-gpu.bat
Last active September 16, 2019 10:13
Script to configure VSCode not to use GPU acceleration
@echo off
setlocal enabledelayedexpansion
rem Additional options to append to VSCode launching command lines.
set ADDTIONAL_OPTS=--disable-gpu
rem insiders, exploration, or other for normal version.
set FLAVOR=insiders
rem VSCode, VSCode Insiders, VSCode Exploration,...
#include <ESP8266WiFi.h> // or WiFi.h for ESP32
#include <WiFiClientSecure.h>
#include <map>
const char* const GOOGLE_APIKEY = "gggggggggggggggggggggggggggggg";
const char* const SLACK_TOKEN = "ssssssssssssssssssssssssssssssssssss";
void setup()
{
pinMode(14,OUTPUT);
@espresso3389
espresso3389 / legendOfHeroes.dart
Created June 16, 2019 21:07
Legend of Heroes
import 'package:flutter/material.dart';
/// The class controls every [Hero] widget has it's own name.
/// If the code generates [Hero.tag] by some model derived algorithm,
/// especially in list widgets such as [ListView.builder], the tag may
/// conflict in some case. The class has internal tag list and if same tag
/// is used twice, it does not insert [Hero] in that case.
/// ```dart
/// Widget build(BuildContext context) {
/*
* The MIT License
*
* Further resources on the MIT License
* Copyright 2018 Cuminas Corporation/@espresso3389
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
@espresso3389
espresso3389 / abortcopytest.mjs
Created March 3, 2018 09:19
Aborting file copy on node.js
'use strict';
import fs from 'fs-extra';
try {
const srcfn = 'sorucefile';
const dstfn = 'tmp.bin';
const src = fs.createReadStream(srcfn);
const dst = fs.createWriteStream(dstfn);
@espresso3389
espresso3389 / keyboard-ja-jp.reg
Created January 26, 2018 03:54
Registry patch to change keyboard layout to 109-ja-jp
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\Parameters]
"LayerDriver JPN"="kbd106.dll"
"OverrideKeyboardIdentifier"="PCAT_106KEY"
"OverrideKeyboardType"=dword:00000007
"OverrideKeyboardSubtype"=dword:00000002