Skip to content

Instantly share code, notes, and snippets.

View urakey's full-sized avatar

akey urakey

View GitHub Profile
@2no
2no / jsdoc_test.js
Created July 15, 2011 02:30
無名関数によるクラス作りのための JSDoc テンプレート
// http://www.wakuworks.com/test/jsdoc/
/**
* 名前空間の説明
* @namespace
*/
var Namespace = Namespace || {};
/**
* クラスの説明など
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@miya0001
miya0001 / example.com.conf
Created October 14, 2011 08:44
nginx+リバースプロキシでバーチャルホスト
#
# A virtual host using WordPress
# /etc/nginx/conf.d/example.com.conf
#
server
{
listen 8080;
client_max_body_size 10m;
server_name .example.com;
@2no
2no / gist:3824817
Created October 3, 2012 03:27
Grunt で js を minify して gzip 圧縮
// 個別で js を minify して gzip したかったので、こんな感じになった
// ファイル名などにスペースが入ってた時どうするのか
module.exports = function(grunt) {
'use strict';
var src = 'shared/js/*.js',
files = grunt.file.expandFiles(src),
suffix = '.min',
minFiles = {},
gzFiles = {};
@hayajo
hayajo / changelog_en.md
Last active July 19, 2024 05:47
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形

@2no
2no / exsample.js
Created November 24, 2012 12:42
jQuery.timeline.js - アニメーションタイムライン
// jQuery、timeline.js を事前に読み込んでおく必要あり
//
// timeline.js について
// - http://hitsujiwool.tumblr.com/post/31191259501/timeline-js
// - https://github.com/hitsujiwool/timeline
// 使い方1:一括指定して実行
var totalFrames = 200,
tl = $("div").timeline(totalFrames)
@mia-0032
mia-0032 / file_get_contents_with_exception.php
Last active December 10, 2015 03:28
file_get_contentsでException飛ばすメモ
<?php
try {
ob_start();
//warningが出るコード
$file = file_get_contents('./not_found_file.txt');
$warning = ob_get_contents();
ob_end_clean();
//Warningがあれば例外を投げる
if ($warning) {
@2no
2no / Gruntfile.js
Last active December 15, 2015 03:38
インデントや複数行続く改行を削除(script, style 要素は除外)
module.exports = function(grunt)
{
'use strict';
grunt.config.init({
html_clean: {
html: {
src: 'sample.html',
newline: '\r\n', // 省略可
},
@2no
2no / Gruntfile.js
Created March 19, 2013 12:27
grunt-templater にパス取得用のヘルパー。現在処理中のテンプレートのパスやファイル名の取得などが行える…はず。$ npm install grunt grunt-templater ejs
module.exports = function(grunt)
{
'use strict';
var ROOT_PATH = '.',
TEMPLATE_PATH = ROOT_PATH + '/templates';
grunt.config.init({
template: {
hoge: {
@2no
2no / Gruntfile.js
Last active December 16, 2015 07:08
grunt.file.write はファイルエンコーディングを指定して保存が可能だが、iconv-lite を使っている関係で SJIS などの保存は出来ない。 別途 iconv をインストールして対応する必要がある。 (ただし、libiconv にパッチをあてないと SJIS-win や EUCJP-win は扱えない)
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
encoding: {
standardSetting: {
toEncoding: 'SJIS'
, files: {
'dest/result.txt': 'src/original.txt'
, 'dest/concat.txt': ['src/concat/*.txt']