Skip to content

Instantly share code, notes, and snippets.

View prog893's full-sized avatar
🧨
best-effort deployments

Torgayev Tamirlan prog893

🧨
best-effort deployments
View GitHub Profile
@matsubo
matsubo / credit_card_bin_codes.md
Last active June 11, 2024 05:23
Credit Card Bin Codes

概要

クレジットカード番号には法則があり、先頭6桁でカードの種類を識別、分類することができる。

詳細はISO/IEC 7812で規定されている。

ISO/IEC 7812 - Wikipedia https://ja.wikipedia.org/wiki/ISO/IEC_7812

先頭の6桁を銀行識別番号(Bank Identification Number、略称:BIN)ないしは発行者識別番号(Issuer Identification Number、略称:IIN)と呼び、この先頭6桁でカード発行会社(イシュア、issuer)が判るようになっている。

Last updated: 2017-03-18

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

@mekza
mekza / betterthanboto.py
Last active September 29, 2023 17:40
Signed URLs and Signed Cookies for CloudFront in Python with boto
from boto.cloudfront.distribution import Distribution
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
import base64
class BetterThanBoto(Distribution):
def sign_rsa(self, message):
@norio-nomura
norio-nomura / VerifyUnicodeNormalization.swift
Created March 25, 2017 08:10
APFSでファイル名がUnicode正規化されないことを検証する
let filenames = [
"\u{30D1}\u{30D1}", // パパ
"\u{30CF}\u{309A}\u{30CF}\u{309A}", // パパ
]
let fm = FileManager.default
let baseURL = fm.urls(for: .documentDirectory, in: .userDomainMask)[0]
filenames.forEach { filename in
let url = baseURL.appendingPathComponent(filename)
let fd = fopen(url.path, "w")