Skip to content

Instantly share code, notes, and snippets.

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

Shin Fujisawa fnobi

🏠
Working from home
View GitHub Profile
@fnobi
fnobi / riot-sample.html
Last active August 19, 2016 08:39
riot sample
<!DOCTYPE html>
<html lang="ja">
<head>
<title>Riot Demo</title>
</head>
<body>
<!-- ここに、yabaiのコンポーネントができてほしい -->
<yabai></yabai>
<!-- 「yabaiタグ」の定義 (外部ファイルに書いて、srcで読み込んでもよい) -->
@fnobi
fnobi / file0.txt
Created December 7, 2014 01:08
iOS・Android向けにアイコンを量産したいとき ref: http://qiita.com/fnobi/items/841e507d5e046951c193
# オリジナルのアイコン画像を original.png とする
# iPhone・Android通して最大のアイコンサイズは180x180なので、original.pngはそれ以上のサイズで用意
# ios
$ convert -resize 120x120 original.png ios/example/Images.xcassets/AppIcon.appiconset/example_icon_app\@2x.png
$ convert -resize 180x180 original.png ios/example/Images.xcassets/AppIcon.appiconset/example_icon_app\@3x.png
$ convert -resize 80x80 original.png ios/example/Images.xcassets/AppIcon.appiconset/example_icon_spotlight\@2x.png
$ convert -resize 120x120 original.png ios/example/Images.xcassets/AppIcon.appiconset/example_icon_spotlight\@3x.png
$ convert -resize 58x58 original.png ios/example/Images.xcassets/AppIcon.appiconset/example_icon\@2x.png
$ convert -resize 87x87 original.png ios/example/Images.xcassets/AppIcon.appiconset/example_icon\@3x.png
@fnobi
fnobi / file0.txt
Last active August 29, 2015 14:07
複数のファイルに対して、特定の語を一気に置き換え ref: http://qiita.com/fnobi/items/6761eb7c64ab1b0d98eb
# project_aを含むファイルを、すべてproject_bに置き換えて保存
ag -l project_a | xargs sed -i '' -e 's/project_a/project_b/g'
@fnobi
fnobi / buzz.sh
Created May 30, 2014 12:23
あるサイトのツイート数・いいね数をterminalで常に表示する ref: http://qiita.com/fnobi/items/4dcf779746bf2385283e
export url=$1
while :
do
likes=$(curl "http://graph.facebook.com/$url" -s | jq '.shares')
tweets=$(curl "http://urls.api.twitter.com/1/urls/count.json?url=$url" -s | jq '.count')
clear
echo $url
echo " - likes: $likes"
@fnobi
fnobi / file0.txt
Created October 21, 2013 17:00
WebAudioAPIで遊べるようになった ref: http://qiita.com/fnobi/items/2f08a67800dec1d61f21
var context = new window.AudioContext();
@fnobi
fnobi / errortracker.js
Created October 10, 2013 06:46
phantomjsで出るエラーだけ追うスクリプト ref: http://qiita.com/fnobi/items/fdcd302c487d1b277246
var system = require('system');
var url = system.args[1];
if (!/^https?:\/\//.test(url)) {
console.error('Pass a url!');
phantom.exit();
}
phantom.onError = function(msg, trace) {
var msgStack = ['PHANTOM ERROR: ' + msg];
@fnobi
fnobi / file0.txt
Created August 23, 2013 09:46
grunt-initと同時に、npm install & bower installもやっちゃう ref: http://qiita.com/fnobi/items/68074616035f20cd23e4
var shellLines = require('./lib/shellLines');
exports.template = function (grunt, init, done) {
init.process( {}, [
init.prompt('name'),
init.prompt('description')
], function(err, props) {
// write package.json
init.writePackageJSON('package.json', pkg);
@fnobi
fnobi / file0.txt
Created August 14, 2013 07:04
asyncって案外すぐ書ける ref: http://qiita.com/fnobi/items/1710ac3259246da44697
// 簡易な非同期処理
var async = function (fns) {
(function exec (index) {
if (!fns[index]) {
return;
}
fns[index](function () {
exec(index + 1);
});
})(0);
@fnobi
fnobi / file0.txt
Created August 12, 2013 14:46
grunt-releaseでversionを上げられる男になろう ref: http://qiita.com/fnobi/items/5f194c83d51fdd7263eb
npm install --save-dev grunt-release
@fnobi
fnobi / Gruntfile.js
Created July 25, 2013 13:32
grunt-simple-ejs作ったので使ってほしい ref: http://qiita.com/fnobi/items/b395b9e5a5358ffd9ad8
options: [
"options.default.json",
"options.dev.json"
]