Skip to content

Instantly share code, notes, and snippets.

View kosh04's full-sized avatar
🎧

KOBAYASHI Shigeru kosh04

🎧
View GitHub Profile
@crmccreary
crmccreary / AESCipher.py
Created May 20, 2013 02:17
Encryption using pycrypto, AES, and PKCS5 padding
from Crypto.Cipher import AES
from Crypto import Random
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s : s[0:-ord(s[-1])]
class AESCipher:
def __init__( self, key ):
"""
@woxtu
woxtu / main.js
Last active January 26, 2023 21:07
Twitter インプレッション アクセスカウンター
const id = "kiriban-fuminige-kinshi";
const conversions = [
{ unit: "K", rate: 1000 },
{ unit: "M", rate: 1000000 },
{ unit: "B", rate: 1000000000 },
{ unit: "万", rate: 10000 },
];
function run(target) {
@addyosmani
addyosmani / pubsub.md
Created October 28, 2011 06:49
Four ways to do Pub/Sub with jQuery 1.7 and jQuery UI (in the future)

#Four Ways To Do Pub/Sub With jQuery and jQuery UI (in the future)

Between jQuery 1.7 and some of work going into future versions of jQuery UI, there are a ton of hot new ways for you to get your publish/subscribe on. Here are just four of them, three of which are new.

(PS: If you're unfamiliar with pub/sub, read the guide to it that Julian Aubourg and I wrote here http://msdn.microsoft.com/en-us/scriptjunkie/hh201955.aspx)

##Option 1: Using jQuery 1.7's $.Callbacks() feature:

$.Callbacks are a multi-purpose callbacks list object which can be used as a base layer to build new functionality including simple publish/subscribe systems. We haven't yet released the API documentation for this feature just yet, but for more information on it (including lots of examples), see my post on $.Callbacks() here:

@rgrove
rgrove / Makefile
Created July 30, 2011 22:01
Simple Makefile to minify CSS and JS.
# Patterns matching CSS files that should be minified. Files with a -min.css
# suffix will be ignored.
CSS_FILES = $(filter-out %-min.css,$(wildcard \
public/css/*.css \
public/css/**/*.css \
))
# Patterns matching JS files that should be minified. Files with a -min.js
# suffix will be ignored.
JS_FILES = $(filter-out %-min.js,$(wildcard \
@esehara
esehara / gist:3160352
Created July 22, 2012 17:21
良い Commit Messageを書きましょう(翻訳)

by https://github.com/erlang/otp/wiki/Writing-good-commit-messages

良いコミットメッセージは、重要な役割が、少なくとも三つあります。

  • レビューするプロセスをスピードアップする。
  • 良いリリースノートを書く手助けになる。
  • 将来、Erlang/OTPのメンテナンスを手助けするため(もしかしたら君かも!)。それは五年後の未来において、なんでコードの中で特定の変更が加えられたのか、あるいは特定の機能が追加されたのか見つけるため、ということ。
@saiten
saiten / radiru.txt
Created September 1, 2011 09:02
らじるらじるをrtmpdumpで録音する
# RTMPEのtype9 handshakeに対応している必要があるのでRTMPDump v2.4必須
# CentOS5 32bitのさくらVPS、OSX Lionで動作確認。(OSX LionではRTMPDumpを32bitでビルド)
# ラジオ第1
rtmpdump --rtmp "rtmpe://netradio-r1-flash.nhk.jp" \
--playpath 'NetRadio_R1_flash@63346' \
--app "live" \
-W http://www3.nhk.or.jp/netradio/files/swf/rtmpe.swf \
--live \
-o r1.m4a
@koron
koron / Changes of profiles of Windows Terminal.md
Last active November 13, 2020 01:59
Windows Terminal の設定ファイルの差分

schema.json とか defaults.json がなんなのかは説明しない。
JSON Schema はソラで読めることが前提。
今後の更新にキャッチアップするかは不明。

1.4.2652.0-preview → 1.5.3142.0-preview

1.5 プレビュー版の変更です。

デフォルトブランチ名の変更

original: https://landshark.io/2020/08/16/web-by-google.html

翻訳のベースには https://www.deepl.com/translator を使い、表現を整えています。

Web by Google™

Mozilla の財務状況を見ると、Google が独占禁止法違反の疑いを寄せ付けないために生命維持をしていると結論づけるのが妥当である。 Mozilla の Google との契約は今後の収益の少なくとも70%を占めることになる。 Googleは4億ドル以上も払って、シェアが4%のブラウザーでデフォルトの検索プロバイダーになるのだ。しかも1年間だけ。 私の次回の給料を賭けてもいいが、Google がこのかなり気前の良い契約を結んだのは、Microsoft の Internet Explorer による独占をめぐるトラブルの再発を避けるためだろう。

@kikairoya
kikairoya / wandbox.l
Last active April 5, 2020 08:04
post to wandbox from xyzzy
(eval-when (:compile-toplevel :load-toplevel :execute)
(require 'xml-http-request)
(require 'json))
(defpackage :wandbox
(:use :lisp :editor))
(in-package "wandbox")
(export '(post-wandbox-region post-wandbox post-wandbox-string show-compiler-list show-compiler-options))
@hyle
hyle / ko.utils.3.0.0.signatures.js
Created October 25, 2013 13:08
KnockoutJS 3.0.0 utils (ko.utils) signatures
// knockout 3.0.0
ko.utils.addOrRemoveItem = function (array, value, included) { /* .. */ }
ko.utils.anyDomNodeIsAttachedToDocument = function (nodes) { /* .. */ }
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }