Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
# This is GNU software: use is permitted -- and encouraged -- but only under the terms set forth at http://www.gnu.org/licenses/gpl.txt.
# Copyright 2002, 2003, 2006 by Scott Walters, scott@illogics.org, and contributors.
# See http://perldesignpatterns.com/?TinyWiki for more information on TinyWiki, and how to configure and use it.
# use Carp; use CGI::Carp 'fatalsToBrowser'; *Carp::longmess_heavy = *Carp::longmess;
exit if $ENV{HTTP_USER_AGENT} =~ m/Java/; # what the FUCK is it with these Java robots pounding the hell out of the site?
umask 0; my $wiki = qr{[A-Z][a-z]+[A-Z][A-Za-z]+}; my $sn = $ENV{SCRIPT_NAME}; my $rip = $ENV{REMOTE_ADDR};
do {
sub a0 ($); sub a1 ($); sub a2 ($); sub a3($); sub a4($); our $text; our $state; our $typeface;
for my $x (0..4) {
@kamawanu
kamawanu / カード決済業務のすべて_読書メモ.md
Created February 23, 2022 12:46
カード決済業務のすべて_読書メモ

1.決済カード業務の概要と実務

カードビジネスの仕組み

業法、主務官庁

日本における業法の守備範囲は以下の通り

  • 割賦販売法・・・クレジットカード
  • 貸金業法・・・キャッシングやカードローンなどの金融商品

所轄官庁は、クレジットカードが経済産業省、金融商品が金融庁
割賦販売法では以下の通り定義されている

  • クレジットカードを使ったショッピング・・・包括信用購入あっせん
<?php
$SRC = file_get_contents($argv[1]);
$TOKENS = token_get_all($SRC);
function safecrlf(& $str){
$hascrlf = preg_match('/[\r\n]/',$str);
$str = addcslashes($str,"\r\n\t ");
return $hascrlf;
@kamawanu
kamawanu / erlang.rst
Created April 8, 2021 17:18 — forked from voluntas/erlang.rst
実践 Erlang/OTP コトハジメ 2014.11

実践 Erlang/OTP コトハジメ 2014.11

更新

2014-11-20

バージョン

0.0.5

作者

@voluntas

URL

http://voluntas.github.io/

概要

@kamawanu
kamawanu / .hgrc
Last active September 10, 2021 16:14
[subrepos]
git:allowed=true
[web]
push_ssl=False
allow_push=*
= Arch Linux step-by-step installation =
= http://blog.fabio.mancinelli.me/2012/12/28/Arch_Linux_on_BTRFS.html =
== Boot the installation CD ==
== Create partition ==
cfdisk /dev/sda
* Create a partition with code 8300 (Linux)
@kamawanu
kamawanu / _readme.md
Created December 19, 2020 18:26 — forked from stecman/_readme.md
Brother P-Touch PT-P300BT bluetooth driver python

Controlling the Brother P-Touch Cube label maker from a computer

The Brother PTP300BT label maker is intended to be controlled using the official Brother P-Touch Design & Print iOS/Android app. The app has arbitrary limits on what you can print (1 text object and up to 3 preset icons), so I thought it would be a fun challenge to reverse engineer the protocol to print whatever I wanted.

Python code at the bottom if you want to skip the fine details.

Process

Intitially I had a quick peek at the Android APK to see if there was any useful information inside. The code that handles the communication with the printer in Print&Design turned out to be a native library, but the app clearly prepares a bitmap image and passes it to this native library for printing. Bitmaps are definitely something we can work with.

@kamawanu
kamawanu / countries_codes_and_coordinates.csv
Created August 12, 2020 14:39 — forked from tadast/countries_codes_and_coordinates.csv
Countries with their (ISO 3166-1) Alpha-2 code, Alpha-3 code, UN M49, average latitude and longitude
Country Alpha-2 code Alpha-3 code Numeric code Latitude (average) Longitude (average)
Afghanistan AF AFG 4 33 65
Albania AL ALB 8 41 20
Algeria DZ DZA 12 28 3
American Samoa AS ASM 16 -14.3333 -170
Andorra AD AND 20 42.5 1.6
Angola AO AGO 24 -12.5 18.5
Anguilla AI AIA 660 18.25 -63.1667
Antarctica AQ ATA 10 -90 0
Antigua and Barbuda AG ATG 28 17.05 -61.8
@kamawanu
kamawanu / ISO3166.py
Created August 10, 2020 20:00 — forked from carlopires/ISO3166.py
Python dict for ISO3166 country codes
# -o- coding: utf-8 -o-
# ISO3166 python dict
# oficial list in http://www.iso.org/iso/iso_3166_code_lists
ISO3166 = {
'AF': 'AFGHANISTAN',
'AX': 'ÅLAND ISLANDS',
'AL': 'ALBANIA',
'DZ': 'ALGERIA',
'AS': 'AMERICAN SAMOA',
#! /bin/sh
set -e
# Don't bother for loopback
if [ "$IFACE" = lo ]; then
exit 0
fi
# Only run from ifup.