てすとてすと
てすてす
#!/usr/bin/env ruby | |
require 'thor' | |
class SSHEnv < Thor | |
SSH_DIR = "~/.ssh" | |
desc 'use PRESET', 'Switch SSH config preset to PRESET' | |
method_option :dry, :type => :boolean, :aliases => '-d' | |
def use(name="default") |
(defun base64 (&optional b e) | |
"base64 encode/decode" | |
(interactive "r") | |
(shell-command-on-region b e "ruby -rbase64 -e 's = $stdin.gets; print Base64.send(/^[A-Za-z0-9\\+\\/=]+$/ =~ s ? :decode64 : :encode64, s).split($/).join'" nil t)) |
(require 'cl) | |
(defun tsv-to-sexp (&optional b e) | |
"TSV to S-exp" | |
(interactive "r") | |
(lexical-let ((str (buffer-substring b e))) | |
(delete-region b e) | |
(insert (pprint (mapcar (lambda (line) (split-string line "\t")) | |
(split-string str "\n")))))) |
(require 'cl) | |
(defun tsv-to-ruby (&optional b e) | |
"TSV to ruby" | |
(interactive "r") | |
(lexical-let ((str (buffer-substring b e))) | |
(delete-region b e) | |
(insert (mapconcat #'identity | |
(list "[" | |
(mapconcat #'tsv-to-ruby-line (split-string str "\n") ",\n ") |
export OCAML_MAJOR_VERSION=4 | |
export OCAML_MINOR_VERSION=00 | |
export OCAML_PATCH_VERSION=0 | |
curl -kL https://raw.github.com/hcarty/ocamlbrew/master/ocamlbrew-install | bash |
#!/usr/bin/env ocamlscript | |
Ocaml.packs := ["batteries"; "netclient"] | |
-- | |
open BatPervasives | |
open Str | |
open Http_client.Convenience | |
let url = "http://matome.naver.jp/odai/2135350364969742801" | |
let pattern = regexp "<img src=\".+\".*class=\"MTMItemThumb\".*/>" |
chmod +x crawler.ml | |
./crawler.ml > photos.html | |
open photos.html |
class DashboardController < ApplicationController | |
include TabsHelper | |
set_tab :dashboard | |
def index | |
end | |
end |
// a Angular.js directive that activates jquery-simple-datetimepicker | |
// | |
// jquery-simple-datetimepicker: | |
// | |
// https://github.com/mugifly/jquery-simple-datetimepicker | |
// | |
// usage: | |
// | |
// <input type="text" ng-model="datetime" ng-dtpicker ng-change="doSomething(datetime)" /> | |
// |