Skip to content

Instantly share code, notes, and snippets.

View TerasawaShuhei's full-sized avatar
:octocat:

Terasawa Shuhei TerasawaShuhei

:octocat:
View GitHub Profile
@TerasawaShuhei
TerasawaShuhei / Monokai Customize.md
Last active December 17, 2015 13:19
Sublime text2 Original Color Scheme

image

Sublime text2 Original Color Scheme

@TerasawaShuhei
TerasawaShuhei / screenshot.js
Created May 20, 2013 22:50
casperjs > screenshot.js スクリーンショット自動化
/*
* Takes provided URL passed as argument and make screenshots of this page with several viewport sizes.
* These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed
*
* Original:
* nhoizey / screenshots.js https://gist.github.com/nhoizey/4060568
*
* Usage:
* $ casperjs screenshots.js http://example.com
@TerasawaShuhei
TerasawaShuhei / capture.js
Created May 20, 2013 22:51
casperjs > capture.js
var screenshotUrl = 'http://example.com/'
var casper = require("casper").create({
viewportSize: {
width: 1280,
height: 1280
}
});
if (casper.cli.args.length < 1) {
@TerasawaShuhei
TerasawaShuhei / .htaccess
Created May 20, 2013 22:54
apache Gzip有効化
#Gzip
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html SetEnvIfNoCase Request_URI \.(?:gif¦jpe?g¦png)$ no-gzip dont-vary Header append Vary User-Agent env=!dont-vary
</IfModule>
@TerasawaShuhei
TerasawaShuhei / shots_from_listed_urls.js
Last active December 17, 2015 14:09 — forked from ahomu/shots_from_listed_urls.js
スクショいっぱい撮るとき。require phantomjs >1.7, async.js >0.2.7
var PARALLEL_LIMIT = 3;
var Page = require('webpage');
var async = require('/Users/shuuheyhey/Sites/async.js');
var i = 0, iz;
var urls = [
"http://css.studiomohawk.com",
"http://inkdesign.jp",
"http://t32k.me/mol",
"http://havelog.ayumusato.com",
"http://aho.mu"
@TerasawaShuhei
TerasawaShuhei / detectVendorFunction.js
Created May 21, 2013 19:58 — forked from ahomu/detectVendorFunction.js
ベンダープレフィックス決めるくん.js
function detectVendorFunction(object, methodName) {
var upperName = methodName.charAt(0).toUpperCase()+methodName.substr(1),
detectedMethod;
detectedMethod = object[methodName] ||
object['webkit'+upperName] ||
object['moz'+upperName] ||
object['ms'+upperName] ||
object['o'+upperName];

AWSのせっていまとめ

インスタンスの作成

SSHでログイン

サーバーを起動させた状態でaction connect。

Connect with a standalone SSH Clientを展開

@TerasawaShuhei
TerasawaShuhei / httpd-vhosts.conf
Created May 23, 2013 01:41
httpd-vhosts-sample.conf
NameVirtualHost *:80
<Directory "/Users/shuuheyhey/Sites">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<VirtualHost _default_:80>
@TerasawaShuhei
TerasawaShuhei / retina.js
Created May 23, 2013 02:03 — forked from deroter/retina.js
retina.js
// retina.js, a high-resolution image swapper (http://retinajs.com), v0.0.2
(function(){function t(e){this.path=e;var t=this.path.split("."),n=t.slice(0,t.length-1).join("."),r=t[t.length-1];this.at_2x_path=n+"@2x."+r}function n(e){this.el=e,this.path=new t(this.el.getAttribute("src"));var n=this;this.path.check_2x_variant(function(e){e&&n.swap()})}var e=typeof exports=="undefined"?window:exports;e.RetinaImagePath=t,t.confirmed_paths=[],t.prototype.is_external=function(){return!!this.path.match(/^https?\:/i)&&!this.path.match("//"+document.domain)},t.prototype.check_2x_variant=function(e){var n,r=this;if(this.is_external())return e(!1);if(this.at_2x_path in t.confirmed_paths)return e(!0);n=new XMLHttpRequest,n.open("HEAD",this.at_2x_path),n.onreadystatechange=function(){return n.readyState!=4?e(!1):n.status>=200&&n.status<=399?(t.confirmed_paths.push(r.at_2x_path),e(!0)):e(!1)},n.send()},e.RetinaImage=n,n.prototype.swap=function(e){function n(){t.el.complete?(t.el.setAttribute("width",t.el.offsetWidth),t.el.
@TerasawaShuhei
TerasawaShuhei / jade.sublime-build
Created May 25, 2013 07:27
jade.sublime-build
{
"cmd": ["jade", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.jade"
}