Skip to content

Instantly share code, notes, and snippets.

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

Takuya Matsuyama craftzdog

🏠
Working from home
View GitHub Profile
@craftzdog
craftzdog / UIImage+Retina4.h
Created September 25, 2012 20:41 — forked from sserye/UIImage+Retina4.h
Swizzled UIImage imageNamed for iPhone 5
//
// UIImage+Retina4.h
// StunOMatic
//
// Created by Benjamin Stahlhood on 9/12/12.
// Updated by noradaiko on 9/26/12.
// Copyright (c) 2012 DS Media Labs. All rights reserved.
// Copyright (c) 2012 noradaiko. All rights reserved.
//
@craftzdog
craftzdog / gist:4073071
Created November 14, 2012 16:19
my tmux conf
unbind C-b
set-option -g prefix C-t
#bind t send-key C-t
# basic settings
#set-option utf8-default on
#set-option -g mouse-select-pane
set-window-option -g mode-keys vi
#set-window-option -g utf8 on
# look'n feel
set-option -g status-fg cyan
module CookbookLogrotate
DIRECTIVES = %w[
compress copy copytruncate daily dateext
delaycompress ifempty mailfirst maillast missingok
monthly nocompress nocopy nocopytruncate nocreate
nodelaycompress nodateext nomail nomissingok noolddir
nosharedscripts noshred notifempty sharedscripts shred
weekly yearly
]
@craftzdog
craftzdog / check_all_iostat
Created April 28, 2013 06:44
This is a nagios plugin for monitoring all disk I/O stats.
#!/bin/bash
#
# Version 0.0.3 - Apr/2013
# Changes: summerize all disk I/O
#
# Version 0.0.2 - Jan/2009
# Changes: added device verification
#
# by Takuya Matsuyama - [email protected]
# by Thiago Varela - [email protected]
@craftzdog
craftzdog / crash_reports_mknetworkkit
Last active December 18, 2015 22:29
I got some crash reports where MKNetworkKit caused exceptions on my app. I hope these reports help to improve MKNetworkKit. Of course, it might be a memory management issue of my app so I'm glad to hear any suggestion. Thanks.
SIGSEGV
_mh_execute_header
Crashed Thread
0
Foundation 0x34fc5b14 +[__NSOperationInternal _observeValueForKeyPath:ofObject:changeKind:oldValue:newValue:indexes:context:]
1
Foundation 0x34fd309b NSKeyValueNotifyObserver
2
Foundation 0x34fd2da5 NSKeyValueDidChange
@craftzdog
craftzdog / 0_reuse_code.js
Created January 27, 2014 15:55
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
(function() {
var Ap = Array.prototype;
var slice = Ap.slice;
var Fp = Function.prototype;
if (!Fp.bind) {
// PhantomJS doesn't support Function.prototype.bind natively, so
// polyfill it whenever this module is required.
Fp.bind = function(context) {
@craftzdog
craftzdog / phantomjs-shims.js
Created December 20, 2014 01:05
PhantomJS shims for supporting HTML5
module.exports = function() {
var Ap = Array.prototype;
var slice = Ap.slice;
var Fp = Function.prototype;
if (!Fp.bind) {
// PhantomJS doesn't support Function.prototype.bind natively, so
// polyfill it whenever this module is required.
Fp.bind = function(context) {
@craftzdog
craftzdog / userContent.css
Created January 6, 2015 10:43
Stylesheet for plain text e-mail on Thunderbird
/* Save it to ~/Library/Thunderbird/Profiles/*.default/chrome/userContent.css */
span[_moz_quote=true] {
color: orange !important;
}
pre[_moz_quote=true] {
color: orange !important;
}
blockquote[type=cite] {
color: orange !important;