This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://stackoverflow.com/questions/4165010/use-jquery-to-auto-select-text-inside-a-span-tag-when-clicked | |
(function($) { | |
$.fn.clickSelect = function() { | |
this.click(function() { | |
var range = document.createRange(); | |
range.setStartBefore(this.firstChild); | |
range.setEndAfter(this.lastChild); | |
var sel = window.getSelection(); | |
sel.removeAllRanges(); | |
sel.addRange(range); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = "2" | |
$script = <<SCRIPT | |
apt-get update | |
# Docker | |
# http://www.atmarkit.co.jp/ait/articles/1406/10/news031.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// http://www.alexedwards.net/blog/making-and-using-middleware | |
import ( | |
"errors" | |
"fmt" | |
"html" | |
"log" | |
"net/http" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
matrix: | |
include: | |
- language: perl | |
perl: "5.16" | |
- language: php | |
php: "5.4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
get '/' do | |
<<'HTML' | |
<html> | |
<head> | |
<script src="js-alert"></script> | |
<script src="html-alert"></script> | |
<script src="js-script"></script> | |
<script src="html-script"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<div id="language">window.navigator.language: </div> | |
<div id="languages">window.navigator.languages: </div> | |
<div id="user-language">window.navigator.userLanguage: </div> | |
<div id="browser-language">window.navigator.browserLanguage: </div> | |
</body> | |
<script> | |
var language = document.getElementById('language'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://docs.docker.com/engine/installation/linux/ubuntulinux/ | |
sudo apt-get update | |
sudo apt-get -y install apt-transport-https ca-certificates | |
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
sudo bash -c 'echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list' | |
sudo apt-get update | |
sudo apt-get -y install linux-image-extra-$(uname -r) | |
sudo apt-get -y install docker-engine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# -*- mode:ruby; coding:utf-8 -*- | |
require 'date' | |
require 'off_time_jp' # https://github.com/masiuchi/off_time_jp | |
if OffTimeJp.off_time? | |
puts 'Forbid pushing in off time' | |
exit false | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant box list | cut -d' ' -f1 | xargs -I {} vagrant box update --box {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start_server --port=5000 --pid-file=mt.pid -- plackup -r -R ./plugins -s Starman mt.psgi |
OlderNewer