Skip to content

Instantly share code, notes, and snippets.

@pi-chan
pi-chan / pre-commit
Created October 2, 2015 07:39
pre-commit
#!/bin/sh
/usr/bin/env ruby $PWD/.git/hooks/prevent-commit-hook.rb
@pi-chan
pi-chan / sample.swift
Created August 26, 2015 13:24
sample
var d : [String:AnyObject] = ["Hoge":"Fuga", "Foo":"Bar"]
if let s = d["Hoge"] as? String {
println(s)
}
if let s = d["Hog"] as? String {
println(s)
}
@pi-chan
pi-chan / ffmpeg.sh
Created July 8, 2015 05:49
動画サイズを変更するコマンドのメモ
ffmpeg -y -i 4.7inch.mp4 -vf scale=640:1136 4.0inch.mp4
@pi-chan
pi-chan / ted.css
Created July 2, 2015 00:53
TEDのtranscriptの時間を非表示にするユーザースクリプト
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("www.ted.com") {
.talk-transcript__para__time {
display: none;
}
}
@pi-chan
pi-chan / DownloadAssetBundle.cs
Created April 29, 2015 02:12
BestHttpDownloadAssetBundle
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using BestHTTP;
@pi-chan
pi-chan / wripe.css
Created February 12, 2015 01:04
wri.peでペインを左右半分ずつ + プレビューを少し大きく
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("wri.pe") {
#edit-page-main-pane {
right: 50% !important;
}
#edit-page-main-pane #edit-page-pane-handle {
display: none;
}
#edit-page-container #edit-page-sidebar-pane {
@pi-chan
pi-chan / await.cs
Last active August 29, 2015 14:12
awaitで処理が返ってこない
private async Task<Message> GetItemIdFromQueue()
{
AmazonSQSClient client = new AmazonSQSClient( ACCESS_KEY, SECRET_KEY, Amazon.RegionEndpoint.APNortheast1 );
ReceiveMessageRequest req = new ReceiveMessageRequest();
req.MaxNumberOfMessages = 1;
req.QueueUrl = QUEUE_URL;
ReceiveMessageResponse res = await client.ReceiveMessageAsync( req ); // この行
if ( res.HttpStatusCode != System.Net.HttpStatusCode.OK ) {
LogError( res.ToString() );
@pi-chan
pi-chan / Parse.podspec
Last active August 29, 2015 14:02
Parse.podspec
Pod::Spec.new do |s|
s.name = 'Parse'
s.version = '1.2.19'
s.license = { :type => 'Commercial', :text => 'See https://parse.com/about/terms' }
s.platform = :ios, '5.0'
s.summary = 'Parse iOS SDK for developing apps using the Parse cloud app platform.'
s.description = 'The Parse iOS SDK enables access to the parse.com cloud app platform. Requires an account with parse.com. To integrate after adding this pod, continue with step 9 in the QuickStart: (https://parse.com/apps/quickstart).'
s.homepage = 'http://parse.com'
s.author = 'Parse'
s.source = { :http => "http://parse-ios.s3.amazonaws.com/66888d7d226541c93c33aa76e5f8e086/parse-library-#{s.version}.zip" }
@pi-chan
pi-chan / rails-composer
Created May 24, 2014 12:04
rails-composer output
% rails new myapp -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/javascripts/application.js
create app/assets/stylesheets/application.css
public class MainActivity extends ActionBarActivity {
public Tasks service;
private static final int REQUEST_ACCOUNT_PICKER = 2;
GoogleAccountCredential mCredential;
private static String PREF_ACCOUNT_NAME = "accountName";
static final String TAG = "TasksSample";
final HttpTransport mHttpTransport = AndroidHttp.newCompatibleTransport();
final JsonFactory mJsonFactory = GsonFactory.getDefaultInstance();