Skip to content

Instantly share code, notes, and snippets.

View kazu69's full-sized avatar
:octocat:
⭐️ 🚀 🍻 🍶

kazu69 kazu69

:octocat:
⭐️ 🚀 🍻 🍶
View GitHub Profile
@kazu69
kazu69 / Readme.md
Created January 29, 2018 15:00
Fibonacci algorithm in Javascript

performance

general.js > memonize.js > simple-loop.js

@kazu69
kazu69 / fail.sh
Last active December 22, 2017 10:08
git rebase -i --root
git init
Initialized empty Git repository in /DIR/.git/
touch a.txt
git add -A
git ci -m "initial commit"
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 a.txt
git rebase -i HEAD^
fatal: Needed a single revision
@kazu69
kazu69 / ajax_helper.rb
Last active December 5, 2017 09:18
capybara helper
module AjaxHelper
def wait_for_css(selector)
until has_css?(selector); end
yield(find(selector))
end
end
@kazu69
kazu69 / ViewController.swift
Created July 6, 2014 10:24
swift UIActionSheet sample
//
// ViewController.swift
//
import UIKit
class ViewController: UIViewController, UIActionSheetDelegate {
@IBAction func tapButton(sender : AnyObject) {
var sheet: UIActionSheet = UIActionSheet();
let title: String = "Please choose a course";
@kazu69
kazu69 / bash.sh
Last active October 14, 2017 10:27
Brew install Mysql5.6
$ brew unlink mysql
$ brew install mysql
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/mysql-5.6.10.lion.bottle.tar.gz
######################################################################## 100.0%
...
@kazu69
kazu69 / Gemfile
Last active October 4, 2017 07:43
Vagrantで作った環境にChef12 でChef Serverをためしてみた
source 'https://rubygems.org'
gem 'chef'
gem 'knife-solo'
@kazu69
kazu69 / error.sh
Last active March 9, 2017 07:55
git error fix. ex: # error: non-monotonic index .git/objects/pack/._pack-6d722bef9143fd3bad7f56161b56fbbf3a39a1f2.idx みたいなエラーが出た
error: non-monotonic index .git/objects/pack/._pack-6d722bef9143fd3bad7f56161b56fbbf3a39a1f2.idx
@kazu69
kazu69 / docker.sh
Created June 23, 2015 04:58
Start with a docker wordpress in 3 minutes
boot2docker up
Waiting for VM and Docker daemon to start...
.........ooo
Started.
Writing /Users/HOME/.boot2docker/certs/boot2docker-vm/ca.pem
Writing /Users/HOME/.boot2docker/certs/boot2docker-vm/cert.pem
Writing /Users/HOME/.boot2docker/certs/boot2docker-vm/key.pem
To connect the Docker client to the Docker daemon, please set:
export DOCKER_HOST=tcp://192.168.59.103:2376
@kazu69
kazu69 / Readme.md
Last active September 12, 2016 16:09
Bypassa CSP form-action XSS example

Bypassa CSP form-action XSS example

try

bundle install
bundle exec ruby app.rb

[2016-09-10 00:01:46] INFO  WEBrick 1.3.1
[2016-09-10 00:01:46] INFO ruby 2.2.2 (2015-04-13) [x86_64-darwin15]
@kazu69
kazu69 / pjax.rb
Created March 13, 2012 16:34
Pjax(pushState + Ajax) with Sinatra and BackboneJs
#encoding: UTF-8
require 'rubygems'
require 'sinatra'
require 'erb'
require 'pp'
class Sinatra::Request
def pjax?
env['HTTP_X_PJAX'] || self['_pjax']