Skip to content

Instantly share code, notes, and snippets.

@shuuheyhey
shuuheyhey / Sublime_Build_LESS.md
Created May 29, 2013 05:18
Sublime Text 2 単体でLESSをコンパイルする設定方法

Sublime Text 2 単体でLESSをコンパイルする方法

まずはnpm(Node Package manager)でlessをインストール

環境によってはsudoを付ける。

$ (sudo) npm install -g less

Node.jsを入れてない場合はこちらを参考に。

@shuuheyhey
shuuheyhey / LESS.sublime-build
Created May 29, 2013 04:18
LESS.sublime-build
{
"cmd": ["lessc", "$file", "${file_path}/${file_base_name}.css", "--verbose"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.css.less",
"osx":
{
"path": "/usr/local/bin:$PATH"
},
@shuuheyhey
shuuheyhey / main.js
Created May 26, 2013 01:20
jQuery(CDN/Fallback) & Bootstrap load by Requirejs
requirejs.config({
baseUrl: 'js',
paths: {
jquery: ['//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min','jquery.min'],
bootstrap: 'bootstrap.min'
},
shim: {
'bootstrap':{deps: ['jquery']}
}
});
{
"name": "example",
"version": "0.0.1",
"description": "An example Jam package",
"dependencies": {
"async": "0.1.22",
"uglify-js": "1.3.4"
, "jshint": "0.9.1"
, "recess": "1.1.6"
, "connect": "2.1.3"
@shuuheyhey
shuuheyhey / haml.sublime-build
Created May 25, 2013 07:29
haml.sublime-build
{
"cmd": "haml",
"selector": "source.haml",
"working_dir": "${file_path}",
"windows":
{
"cmd": ["haml.bat", "$file", "$file_path/$file_base_name.html"]
},
@shuuheyhey
shuuheyhey / jade.sublime-build
Created May 25, 2013 07:27
jade.sublime-build
{
"cmd": ["jade", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.jade"
}
@shuuheyhey
shuuheyhey / 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.
@shuuheyhey
shuuheyhey / 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>

AWSのせっていまとめ

インスタンスの作成

SSHでログイン

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

Connect with a standalone SSH Clientを展開

@shuuheyhey
shuuheyhey / 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];