Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
⭐️ 🚀 🍻 🍶

kazu69 kazu69

:octocat:
⭐️ 🚀 🍻 🍶
View GitHub Profile
@kazu69
kazu69 / 1.md
Last active Oct 28, 2015
My First gulp hanson
View 1.md

Hello gulp

About gulp

gulpはweb開発をする時に発生するフロントエンドなどの諸問題をタスクで支援するツールです。 (フロントエンドだけに限らない)

今回は以下のタスクを行うgulpファイルを作成してみます

  • Serverの起動
View Dockerfile
FROM ubuntu
RUN apt-get update
RUN apt-get install -y wget curl mercurial build-essential libpcre3 libpcre3-dev zlib1g-dev
RUN apt-get -y update
WORKDIR /usr/local/src/
RUN wget http://nginx.org/download/nginx-1.9.4.tar.gz -O nginx.tar.gz
RUN tar -xzvf nginx.tar.gz && mv nginx-1.9.4 nginx
@kazu69
kazu69 / example.md
Created Oct 22, 2015
Rails tinyint(1) use boolean false
View example.md

emulate_booleans

デフォルトではtrue。つまりtinyint(1) はbooleanとして扱うことになる。 tinyint(1) は0~255の値を扱えるのでこのままでは不都合が生じた。

解決策

  1. この設定をfalseにする
  2. activemodel側で再度キャストする

どちらもドキュメントにあるのね。

@kazu69
kazu69 / agent.go
Last active Oct 20, 2015
golang simple crawler
View agent.go
package main
import (
"crypto/tls"
"flag"
"golang.org/x/net/html"
"log"
"net/http"
"net/url"
"fmt"
@kazu69
kazu69 / create.sh
Created Oct 13, 2015
Try Subresource_Integrity
View create.sh
wget https://code.jquery.com/jquery-1.11.3.min.js
cat jquery-1.11.3.min.js | openssl dgst -sha256 -binary | openssl enc -base64
7LkWEzqTdpEfELxcZZlS6wAx5Ff13zZ83lYO2/ujj7g=
@kazu69
kazu69 / identity.js
Last active Oct 10, 2015
Haskell like monad in ES6
View identity.js
var UpperCase = value => {
if(!value) return value;
return value.toUpperCase();
}
var LowerCase = value => {
if(!value) return value;
return value.toLowerCase();
}
View cli-task-json.sh
gulp --tasks-json
[{"label":"<anonymous>","type":"function","nodes":[]},{"label":"one","type":"task","nodes":[]},{"label":"two","type":"task","nodes":[]},{"label":"three","type":"task","nodes":[]},{"label":"parallel","type":"task","nodes":[{"label":"<parallel>","type":"function","nodes":[{"label":"one","type":"task","nodes":[]},{"label":"two","type":"task","nodes":[]},{"label":"three","type":"task","nodes":[]},{"label":"<anonymous>","type":"function","nodes":[]}]}]},{"label":"series","type":"task","nodes":[{"label":"<series>","type":"function","nodes":[{"label":"three","type":"task","nodes":[]},{"label":"one","type":"task","nodes":[]},{"label":"two","type":"task","nodes":[]},{"label":"<anonymous>","type":"function","nodes":[]}]}]},{"label":"combine","type":"task","nodes":[{"label":"<series>","type":"function","nodes":[{"label":"one","type":"task","nodes":[]},{"label":"<series>","type":"function","nodes":[{"label":"two","type":"task","nodes":[]},{"label":"<series>","type":"function","nodes":[{"label":"three","
@kazu69
kazu69 / doc.md
Created Aug 11, 2015
Cross compile mruby of cli app using mruby-cli
View doc.md

mruby-cliを使ってmruby cliをクロスコンパイル

mruby-cliを使えば、mrubyのcliアプリケーションを

  • Linux (64-bit)
  • Linux (32-bit)
  • OS X (64-bit)
  • OS X (32-bit)
  • Windows (64-bit)
View 3colums.html
<section class="container px2 py3">
<div class="clearfix mxn2">
<div class="sm-col sm-col-4 px2">
<h2 class="h1 mb0">Bacon</h2>
<p>Bacon ipsum dolor sit amet chuck prosciutto landjaeger ham hock filet mignon shoulder hamburger pig venison. Ham bacon corned beef, sausage kielbasa flank tongue pig drumstick capicola swine short loin ham hock kevin.</p>
</div>
<div class="sm-col sm-col-4 px2">
<h2 class="h1 mb0">Bratwurst</h2>
<p>Bacon ipsum dolor sit amet chuck prosciutto landjaeger ham hock filet mignon shoulder hamburger pig venison. Ham bacon corned beef, sausage kielbasa flank tongue pig drumstick capicola swine short loin ham hock kevin.</p>
</div>
@kazu69
kazu69 / boot2docker-portforwarding.sh
Last active Aug 29, 2015
boot2docker portforwarding virtualbox
View boot2docker-portforwarding.sh
VBoxManage controlvm "boot2docker-vm"
# 以下が使用できる ----------------------------
natpf<1-N> [<rulename>],tcp|udp,[<hostip>],<hostport>,[<guestip>],<guestport> |
natpf<1-N> delete <rulename> |
# ---------------------------------------------
# localhostの8080番ポートをboot2docker-vmの80番ポートにフォワーディング
# tcp-8080という名前をつけている
VBoxManage controlvm "boot2docker-vm" natpf1 "tcp-8080,tcp,127.0.0.1,8080,,80"