Skip to content

Instantly share code, notes, and snippets.

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

kazu69 kazu69

:octocat:
⭐️ 🚀 🍻 🍶
View GitHub Profile
@kazu69
kazu69 / viewController.swift
Created July 6, 2014 09:20
swift delegate sample
//
// ViewController.swift
//
//
import UIKit
class ViewController: UIViewController, UITextFieldDelegate {
@IBOutlet var myTextField : UITextField
vagrant halt
# viで不要なを消すでもいいかも
rm -rf /etc/exports
touch /etc/exports
vagrant up
@kazu69
kazu69 / Berksfile
Last active August 29, 2015 14:04
Chef-Container Betaを試してみた
source "https://api.berkshelf.com"
cookbook "apache2"
cookbook "apt"
@kazu69
kazu69 / application.rb
Last active August 29, 2015 14:04
Rails custom validation (validates_each) sample. validates_eachの場合は1つの属性値だけのvalidation。
# config/application.rb
require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want:
require "active_model/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
@kazu69
kazu69 / application.rb
Created July 21, 2014 14:05
Rails custom validation (validates_each) sample. validates_withの場合は複数の属性のvalidation。
# config/application.rb
require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want:
require "active_model/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
@kazu69
kazu69 / Rakefile
Last active August 29, 2015 14:04
Rails4.1.4 create rails plugin width rspec
# Rakefile
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
require 'rdoc/task'
@kazu69
kazu69 / jquery.cookie.js
Created August 8, 2014 06:02
jquery.cookie.js
@kazu69
kazu69 / jquery.droppy.js
Created August 8, 2014 06:07
jquery.droppy.js
/*
* Droppy 0.1.2
* (c) 2008 Jason Frame (jason@onehackoranother.com)
*/
$.fn.droppy = function(options) {
options = $.extend({speed: 250}, options || {});
this.each(function() {
@kazu69
kazu69 / jquery.styleswichter.js
Created August 8, 2014 06:32
jquery.styleswichter.js
/*
Copyrights (C) 2008 David Esperalta <davidesperalta@gmail.com>
This file is part of StyleSwichter jQuery plugin for jQuery
StyleSwichter is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
@kazu69
kazu69 / time-tracker.js
Created August 8, 2014 07:31
time-tracker.js
/**
* Copyright 2007 Google, Inc.
* This sample code is under the Apache2 license, see
* http://www.apache.org/licenses/LICENSE-2.0 for license details.
*/
var TimeTracker=function(opt_bucket){if(opt_bucket){this.bucket_=opt_bucket.sort(this.sortNumber)}else{this.bucket_=TimeTracker.DEFAULT_BUCKET}};TimeTracker.prototype.startTime_;TimeTracker.prototype.stopTime_;TimeTracker.prototype.bucket_;TimeTracker.DEFAULT_BUCKET=[100,500,1500,2500,5000];TimeTracker.prototype._getTimeDiff=function(){return(this.stopTime_-this.startTime_)};TimeTracker.prototype.sortNumber=function(a,b){return(a-b)};TimeTracker.prototype._recordStartTime=function(opt_time){if(opt_time!=undefined){this.startTime_=opt_time}else{this.startTime_=(new Date()).getTime()}};TimeTracker.prototype._recordEndTime=function(opt_time){if(opt_time!=undefined){this.stopTime_=opt_time}else{this.stopTime_=(new Date()).getTime()}};TimeTracker.prototype._track=function(tracker,opt_event_obj_name,opt_event_label){var eventTracker;if(opt_event_obj_name!=un