This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'thor' | |
class Generator < Thor::Group | |
include Thor::Actions | |
argument :name | |
class_option :username, aliases: '-u', required: true | |
class_option :domain, aliases: '-d' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'dragonfly' | |
require 'dragonfly/s3_data_store' | |
Dragonfly.app.configure do | |
plugin :imagemagick | |
secret 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | |
## :sha をformatに入れておくことで、query stringにならない | |
url_format "/media/:job/:sha/:name" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. ssh-keygen -t rsa | |
2. cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys | |
3. chmod og-wx ~/.ssh/authorized_keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* OrderedBehavior 2.2.2 | |
* | |
* | |
* This behavior lets you order items in a very similar way to the tree | |
* behavior, only there is only 1 level. You can however have many | |
* independent lists in one table. Usually you use a foreign key to | |
* set / see what list you are in (see example bellow) or if you have | |
* just one list for the entire table, you can do that too. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Distributed under The MIT License: | |
http://opensource.org/licenses/mit-license.php | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// paragraphStyle | |
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle defaultParagraphStyle] mutableCopy]; | |
[paragraphStyle setLineSpacing:10.0f]; | |
paragraphStyle.maximumLineHeight = 15.0f; | |
/// mutableAttributedString | |
NSMutableAttributedString *attrStr = [NSMutableAttributedString attributedStringWithString:value]; | |
/// 特定の条件 | |
NSArray *hogeRanges = [value hogeRanges]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name chatwork to all helper | |
// @match https://www.chatwork.com/* | |
// @version 1.2 | |
// ==/UserScript== | |
(function() { | |
document.getElementById('_chatText').addEventListener('blur', function(e){ | |
if (/[@@]{2}/.test(e.target.value)) { | |
var to_list = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /usr/local/src/ | |
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | |
tar xf libevent-2.0.21-stable.tar.gz | |
./configure --prefix=/usr/local/libevent2 | |
make | |
paco -D make install | |
cd /usr/local/src/ | |
wget http://downloads.sourceforge.net/tmux/tmux-1.8.tar.gz | |
tar xf tmux-1.8.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
#-*- encoding: utf-8 -*- | |
# | |
# setup git-hook pre-commit command | |
# > bundle install --path [bundle_path] | |
# > curl -o .git/hooks/pre-commit https://raw.github.com/gist/5283926 | |
# > chmod +x .git/hooks/pre-commit | |
require "sass/plugin" | |
puts "# pre-commit:gist-5283926 on git-hook." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# Git pre-commit hook script to verify file encodings. | |
# Works with Perl 5.8. The bundled perl in msysgit is also supported. | |
# Copyright (C) 2012 Takeshi Yaegashi | |
# Encodings allowed to be committed. | |
my @allowed = qw/ascii utf8/; | |
# Encodings possible to be seen - optional. |