Skip to content

Instantly share code, notes, and snippets.

View rakuishi's full-sized avatar
🏠
Working from home

OCHIISHI Koichiro rakuishi

🏠
Working from home
View GitHub Profile
@ishikawa
ishikawa / gist:88599
Created April 1, 2009 07:49
Java Sample Code for Calculating HMAC-SHA1 Signatures
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.SignatureException;
import java.util.Formatter;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
/**
http://fladdict.net/blog/2011/02/auto-kerning.html
グローバル汚染を無くしたのと、jQueryらしくかけるようにしました。
// 引数なしの場合デフォルトのカーニングが摘要される。
$(selector).FLAutoKerning();
// 引数を入れた場合、そのカーニングが摘要される。
$(selector).FLAutoKerning(myKerningInfo);
ライセンスは元のFLAutoKerning.jsを継承します。
@ethertank
ethertank / jQueryPlugInTemplate.js
Last active May 26, 2017 08:55
オプション付きjQueryプラグインの最小構成テンプレート
/* 先頭行: 他のスクリプトでのセミコロン忘れに備え、且つ、予約語でないundefinedの書換えによる誤動作を防いでいる。*/
;(function($, undefined) {
"use strict";
$.fn.myPlugIn = function(option) {
var a, b, c;
//※未設定のオプション項目に初期値を設定
option = $.extend({
opt1: null,
@daichan4649
daichan4649 / AndroidManifest.xml
Created August 3, 2012 10:37
NFC sample(read IDm)
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="test.nfc"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.NFC" />
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="15" />
@setoh2000
setoh2000 / gist:3895173
Created October 15, 2012 20:25
Twitter.frameworkやSocial.frameworkのツイート画面でカーソルの初期位置を先頭にする
#import <Twitter/Twitter.h>
#import <Social/Social.h>
// TWTweetComposeViewControllerの場合 (for iOS5)
- (IBAction)tweet:(id)sender
{
if ([TWTweetComposeViewController canSendTweet]) {
// ツイート用の画面をを表示する
TWTweetComposeViewController* composeViewController = [[TWTweetComposeViewController alloc] init];
[composeViewController setInitialText:@"Hello World!"];
@hayajo
hayajo / changelog_en.md
Last active April 1, 2025 14:37
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形

@tadasuke
tadasuke / sort.php
Created December 13, 2012 06:48
多次元配列で特定のキーの値でソートする
/**
* 配列の特定のキーを元にソートする
* @param array $array
* @param string $sortKey
* @param int $sortType
*/
function sortArray( &$array, $sortKey, $sortType = SORT_ASC ) {
$tmpArray = array();
foreach ( $array as $key => $row ) {
# -*- coding: utf-8 -*-
require 'fileutils'
require 'date'
require 'yaml'
require 'uri'
require 'rexml/document'
include REXML
doc = Document.new File.new(ARGV[0])
@julianshen
julianshen / CircleTransform.java
Last active November 6, 2023 12:47
CircleTransform for Picasso
/*
* Copyright 2014 Julian Shen
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@JakeWharton
JakeWharton / dex.sh
Last active March 25, 2024 13:54
`classes.dex` method count helpers. Requires smali/baksmali from https://code.google.com/p/smali/ and dexdump from the build-tools in the Android SDK be on your PATH.
function dex-method-count() {
cat $1 | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"'
}
function dex-method-count-by-package() {
dir=$(mktemp -d -t dex)
baksmali $1 -o $dir
for pkg in `find $dir/* -type d`; do
smali $pkg -o $pkg/classes.dex
count=$(dex-method-count $pkg/classes.dex)
name=$(echo ${pkg:(${#dir} + 1)} | tr '/' '.')