This file contains hidden or 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
# https://scrapbox.io/hotchpotch/MacOS_%E3%83%A6%E3%83%BC%E3%82%B6%E3%81%8C_Windows_%E3%81%AE%E9%96%8B%E7%99%BA%E7%92%B0%E5%A2%83%E3%82%92%E6%95%B4%E3%81%88%E3%82%8B%E3%81%BE%E3%81%A7 | |
if (Test-Path alias:arch) { Remove-Item alias:arch } | |
function arch() { $input | uutils arch $args } | |
if (Test-Path alias:base32) { Remove-Item alias:base32 } | |
function base32() { $input | uutils base32 $args } | |
if (Test-Path alias:base64) { Remove-Item alias:base64 } | |
function base64() { $input | uutils base64 $args } | |
if (Test-Path alias:basename) { Remove-Item alias:basename } | |
function basename() { $input | uutils basename $args } |
This file contains hidden or 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 ruby | |
# | |
# base: https://stackoverflow.com/questions/11895641/programmatically-get-a-list-of-characters-a-certain-ttf-font-file-supports | |
# | |
require 'ttfunk' | |
ttf_file = ARGV.shift | |
ttf = TTFunk::File.open ttf_file |
This file contains hidden or 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
{ | |
"title": "Switch IM", | |
"rules": [ | |
{ | |
"description": "right_control -> CN", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "right_control" |
This file contains hidden or 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
diff --git a/hal/targets.json b/hal/targets.json | |
index 7ce4ad8..3e8969c 100644 | |
--- a/hal/targets.json | |
+++ b/hal/targets.json | |
@@ -1464,16 +1464,18 @@ | |
"macros_add": ["TARGET_RBLAB_NRF51822"] | |
}, | |
"RBLAB_BLENANO": { | |
- "inherits": ["MCU_NRF51_16K"], | |
- "release_versions": ["2"] |
This file contains hidden or 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
BoldAsFont=no | |
CursorType=block | |
Font=Ricty Diminished | |
FontHeight=14 | |
WindowShortcuts=no | |
Transparency=off | |
FontSmoothing=full | |
Term=xterm-256color | |
Locale=ja_JP | |
Charset=UTF-8 |
This file contains hidden or 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
require 'spi_mcp' | |
mcp = MCP3208.new | |
val = mcp.channel(0) | |
puts val # 0 ~ 4095 |
This file contains hidden or 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
TARGET_EXT=readline; cd ~/.rbenv/sources; for x in *; do cd ~/.rbenv/sources/${x}/ruby-${x}; pwd; rm -vf .ext/*/$TARGET_EXT.bundle ext/$TARGET_EXT/Makefile ext/$TARGET_EXT/*.o; make install-ext; done |
This file contains hidden or 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/ruby | |
# encoding: UTF-8 | |
if `pbpaste`.match(/“(.*?)”/m) | |
target = $1.chomp | |
require 'open3' | |
puts target | |
Open3.popen3( 'pbcopy' ) {|input, _, _| input << target } | |
end |
This file contains hidden or 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
extension Int { | |
func fizzbuzz() -> String { | |
switch (self % 3 == 0, self % 5 == 0) { | |
case (true, false): | |
return "Fizz" | |
case (false, true): | |
return "Buzz" | |
case (true, true): | |
return "FizzBuzz" | |
default: |
This file contains hidden or 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
def glitchnize(image_data) | |
bytes = image_data.bytes | |
length = image_data.length | |
d = Pointer.new(:uchar, length) | |
length.times do |i| | |
c = bytes[i] | |
if c == 42 && rand > 0.8 | |
d[i] = rand(255) | |
else | |
d[i] = c |