Skip to content

Instantly share code, notes, and snippets.

View cathandnya's full-sized avatar

nya cathandnya

View GitHub Profile
@swillits
swillits / Keycodes.swift
Last active March 26, 2024 23:20
Swift Keyboard Keycodes
struct Keycode {
// Layout-independent Keys
// eg.These key codes are always the same key on all layouts.
static let returnKey : UInt16 = 0x24
static let enter : UInt16 = 0x4C
static let tab : UInt16 = 0x30
static let space : UInt16 = 0x31
static let delete : UInt16 = 0x33
static let escape : UInt16 = 0x35
@zaftzaft
zaftzaft / ugoira.js
Created June 27, 2014 16:13
PixivのUgoiraをGIFにするブックマークレット的なやつ
// あとでリファクタリングする
var b = "https://raw.githubusercontent.com/antimatter15/jsgif/master/";
var u = [
"LZWEncoder.js", "NeuQuant.js", "GIFEncoder.js", "Demos/b64.js"
];
$("canvas").remove();
var $c = $("<canvas>").appendTo("body");
var ctx = $c[0].getContext("2d");
var d = document;
@devunwired
devunwired / GifDecoder.java
Last active January 26, 2024 21:14
An optimized implementation of GifDecoder for Android devices.
/**
* Copyright (c) 2013 Xcellent Creations, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@matchy256
matchy256 / rec_radiko.sh
Last active October 31, 2023 08:23 — forked from saiten/rec_radiko.sh
簡易Radiko録音スクリプト
#!/bin/bash
LANG=ja_JP.utf8
pid=$$
date=`date '+%Y-%m-%d-%H_%M'`
outdir="."
if [ $# -le 1 ]; then
@STAR-ZERO
STAR-ZERO / FontFitTextView.java
Created June 15, 2012 03:18
【Android】横幅に合わせてテキストサイズを調整するTextView
import android.content.Context;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.widget.TextView;
/**
* サイズ自動調整TextView
*
*/
@func09
func09 / Ti.UI.ImageView#imageWithCache
Created April 20, 2011 10:37
TitaniumのImageViewでリモートURLの画像を永続的にキャッシュする
$$$ = {};
$$$.ui = {};
$$$.ui.createImageView = function(options){
var ui = Ti.UI.createImageView(options);
// 画像を永続化してキャッシュ
ui.imageWithCache = function(url){
url = url.replace(/\?[0-9]+$/,'');
@saiten
saiten / rec_radiko.sh
Last active December 2, 2021 05:57
簡易radiko録音ツール。要swftools
#!/bin/sh
playerurl=http://radiko.jp/apps/js/flash/myplayer-release.swf
cookiefile=./cookie.txt
playerfile=./player.swf
keyfile=./authkey.png
if [ $# -eq 1 ]; then
channel=$1
output=./$1.flv
@Pretz
Pretz / gist:822036
Created February 11, 2011 07:09
xAuth in Android for Instapaper using Signpost
protected String[] doInBackground(String... credentials) {
String consumer_secret = mActivity.getString(R.string.oauth_consumer_secret);
HttpClient client = new DefaultHttpClient();
HttpPost request = new HttpPost("https://www.instapaper.com/api/1/oauth/access_token");
CommonsHttpOAuthConsumer consumer = new CommonsHttpOAuthConsumer(mActivity.getString(R.string.oauth_consumer_key),
consumer_secret);
List<BasicNameValuePair> params = Arrays.asList(
new BasicNameValuePair("x_auth_username", credentials[0]),
new BasicNameValuePair("x_auth_password", credentials[1]),
new BasicNameValuePair("x_auth_mode", "client_auth"));