Skip to content

Instantly share code, notes, and snippets.

@yoggy
yoggy / overriding-backticks-test.rb
Last active November 29, 2017 05:42
Rubyではバッククォートをオーバーライドできてしまうという個人的な驚き
#!/usr/bin/ruby
def `(str)
'Wed Nov 29 12:34:56 JST 2017'
end
puts `date`
@yoggy
yoggy / imgsplit.py
Last active November 28, 2017 09:09
OpenCVを使った画像の分割ツール。縦スクロール用
import numpy as np
import cv2
import sys
import os
if (len(sys.argv)!=4):
print("usage : {0} step_h overlap_h filename".format(sys.argv[0]))
sys.exit()
step_h = int(sys.argv[1])
@yoggy
yoggy / Androidでスクリーンショット撮影例.bat
Created November 21, 2017 06:58
Androidでスクリーンショット撮影例.bat
rem
rem Androidでスクリーンショット撮影例.bat
rem adbとImageMagickを使用
rem
rem license:
rem Copyright (c) 2017 yoggy <yoggy0@gmail.com>
rem Released under the MIT license
rem http://opensource.org/licenses/mit-license.php;
rem
@yoggy
yoggy / 何かと便利なBusPirateの使い方メモ.md
Last active February 5, 2023 10:17
何かと便利なBusPirateの使い方メモ
$ ps ax | grep -i wayland
822 tty1 Ssl+ 0:00 /usr/lib/gdm3/gdm-wayland-session env GNOME_SHELL_SESSION_MODE=ubuntu gnome-session --session=ubuntu
921 tty1 Sl+ 0:01 /usr/bin/Xwayland :0 -rootless -noreset -listen 4 -listen 5 -displayfd 6
8302 pts/0 S+ 0:00 grep --color=auto -i wayland
$ apt-file search Xwayland
xwayland: /usr/bin/Xwayland
$ apt-cache depends xwayland
xwayland
$ cat a.txt
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
cccccccccccccccccccccccccccccccccccccccccccccccccc
あああああああああああああああああああああああああああああああ
いいいいいいいいいいいいいいいいいいいい
うううううううううううううう
123123123123123123123123123123123123
$ cat a.txt | ruby -ple 'l="";n=0;$_.each_char{|c|l+=c;n+=(c.ord<128?1:2);if(n>40) then n=0;l+="\n" end};$_=l'
//
// file2string.cpp
//
// see also... https://stackoverflow.com/questions/2602013/read-whole-ascii-file-into-c-stdstring
//
#include <fstream>
#include <sstream>
#include <iostream>
int main(int argc, char *argv[])
void setup() {
size(600, 480);
}
void draw() {
float x = random(0, width);
float y = random(0, height);
float l = random(0, width / 5);
float r = random(0, 255);
package net.sabamiso.android.aestest;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Base64;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
@yoggy
yoggy / Privacy policy for Android application.md
Created March 6, 2017 07:09
Privacy policy for Android application

Privacy policy (for https://play.google.com/store)

This software is released under the MIT License. You can see the sourcecode in my github repository. Please see the source code about the handling of personal data.

Copyright and license

Copyright (c) 2017 yoggy