Skip to content

Instantly share code, notes, and snippets.

View cognitom's full-sized avatar

Tsutomu Kawamura cognitom

View GitHub Profile
$ npm install -g gulp
$ npm install -g gulp-straw
@cognitom
cognitom / file0.txt
Created October 5, 2014 05:28
すべてはタスクの再利用性を高めるために - gulp.js ref: http://qiita.com/cognitom/items/3d8f87cb338b546a6504
$ straw install gulpfile
[OK] cognitom:gulpfile > gulpfile
installing required modules in taskfiles...
[OK] installation completed
$ ls
gulpfile.js node_modules package.json
@cognitom
cognitom / file0.yml
Last active August 29, 2015 14:12
Ansibleでファイルの行を書き換える3つの方法 ref: http://qiita.com/cognitom/items/57de72b739642041dcd5
- name: "設定の修正(1)"
lineinfile: >-
dest='/path/to/file/'
state=present
backrefs=yes
regexp='^#?\s*ServerTokens'
line='ServerTokens Prod'
@cognitom
cognitom / designer.html
Created December 30, 2014 10:34
designer
<link rel="import" href="../core-menu/core-submenu.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-header-panel/core-header-panel.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../paper-toast/paper-toast.html">
<polymer-element name="my-element">
@cognitom
cognitom / index.html
Last active May 7, 2020 08:57
Partial Zoom in Mobile Safari
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
<style>
body {
margin: 40px 0 0 0;
padding: 0;
@cognitom
cognitom / file0.html
Last active August 29, 2015 14:12
AngularとBrowserifyの微妙すぎる関係 ref: http://qiita.com/cognitom/items/1f5d82a4513af446cb57
<script src="bower_components/todomvc-common/base.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="js/app.js"></script>
<script src="js/controllers/todoCtrl.js"></script>
<script src="js/services/todoStorage.js"></script>
<script src="js/directives/todoFocus.js"></script>
<script src="js/directives/todoEscape.js"></script>
@cognitom
cognitom / file0.txt
Last active August 29, 2015 14:13
CommonJSフレンドリーな、Angularアノテーション ref: http://qiita.com/cognitom/items/c7b4ffcd26f87b66af8a
// インジェクション方法 A
$injector.invoke(function(serviceA){});
@cognitom
cognitom / .htaccess
Created March 31, 2015 04:25
Underscore2Hyphen
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule (.*)_(.*) $1-$2 [N=10,DPI]
RewriteRule (.*) http://somewhere.dom/$1 [R=301]
</IfModule>
/* Riot WIP, @license MIT, (c) 2015 Muut Inc. + contributors */
;(function(window, undefined) {
'use strict'
var riot = { version: 'WIP', settings: {} }
// This globals 'const' helps code size reduction
// for typeof == '' comparisons
var T_STRING = 'string',
@cognitom
cognitom / index.js
Created June 29, 2016 03:39
How to get [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] in JavaScript
// ES6
[...Array(10).keys()]
Array(10).map((n, i) => i)
Array.from(Array(10).keys())
Array.from({ length:10 }, (v, i) => i)
// ES5
Array(10).map(function(n, i) { return i })
// Oldies