Skip to content

Instantly share code, notes, and snippets.

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

Y.Yamamoto tuki0918

🏠
Working from home
View GitHub Profile
@davoclavo
davoclavo / dataURItoBlob.js
Last active September 2, 2024 04:00
Convert dataURI to Blob so large images do not crash the browser. Based on: http://stackoverflow.com/questions/10412299 and http://stackoverflow.com/questions/6850276
/*
The MIT License (MIT)
Copyright (c) 2016 David Gomez-Urquiza
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:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
@thash
thash / post.md
Created December 21, 2012 19:35
bitbucketのservice hookでpostされてくるパラメータ例

POSTパラメータ

{"payload"=>
  {"repository": {"website": "",
                  "fork": false,
                  "name": "test",
                  "scm": "git",
                  "absolute_url": "/memerelics/test/",
 "owner": "memerelics",
@rummelonp
rummelonp / percol_zsh.md
Created December 7, 2012 15:57
percol 入れて zsh と組み合わせたら超便利

percol 入れて zsh と組み合わせたら超便利

だったので紹介

percol とは

percol は入力の1行を1候補として,部分一致かつ AND 検索で絞り込みし,選択した候補を出力するコマンドです.端的に言えば Emacs の anything.el のコマンド版です.
@mogya
mogya / stringUtil.js
Created December 7, 2012 15:56
JavaScript String utility
/** 文字列の前後の空白を削除 */
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, "");
}
/** 文字列の改行を削除 */
String.prototype.trim_newline = function(){
return this.toString().replace(/\n/g, '');
}
/** 最後が特定の文字で終わるようにした文字列を返す。
主に、パス名が/で終わることを強制するのに使う
@msng
msng / gist:4023716
Created November 6, 2012 09:40
日本の「国民の祝日」の英語名と日本語名を対応させる配列。キーに英語名、値に日本語名を取る。
array(
"New Year's Day" => '元日',
"Coming-of-Age Day" => '成人の日',
"National Foundation Day" => '建国記念の日',
"Vernal Equinox Day" => '春分の日',
"Showa Day" => '昭和の日',
"Constitution Memorial Day" => '憲法記念日',
"Greenery Day" => 'みどりの日',
"Children's Day" => 'こどもの日',
"Marine Day" => '海の日',
@hayajo
hayajo / changelog_en.md
Last active April 1, 2025 14:37
ChangeLog を支える英語

ChangeLog を支える英語

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

ほとんど引用です。

基本形

@Kindari
Kindari / example.php
Created September 19, 2012 23:27
Locale aware Api routing in Laravel 3
<?php // bundles/api_v1/controllers/example.php
class Api_V1_Example_Controller extends Controller
{
public $restful = True;
public function get_hello($name='World')
{
return "Hello, {$name}!";
}
@erkie
erkie / background.html
Created May 19, 2012 09:43
Save parts of screen using Chrome extension
<script>
var Constants = {
saveURL: 'http://random/birthday/saveimage.php',
w: 500,
h: 500,
x: 200,
y: 200
};
@wataru420
wataru420 / addUser
Created February 7, 2012 03:54
Jenkins init script for centos
/usr/sbin/groupadd -g 30119 jenkins
/usr/sbin/useradd -u 30119 -g jenkins jenkins
mkdir /home/jenkins
chown -R jenkins. /home/jenkins
@astronaughts
astronaughts / app.js
Created December 19, 2011 15:14
Baruth vol.1
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();
var win = Titanium.UI.createWindow();
win.hideTabBar();
win.navBarHidden = true;
var tab = Titanium.UI.createTab({window: win});
var Z_INDEX_TOP = 3;
var Z_INDEX_BOTTOM = 0;