Skip to content

Instantly share code, notes, and snippets.

View takuya's full-sized avatar

takuya@mori takuya

  • Osaka City Univ
  • Osaka,Japan
View GitHub Profile
require 'mechanize'
m = Mechanize.new
m.get 'http://t.co'
return if m.page.uri.to_s =~ %r'^https?://t.co'
m.page.forms[0].submit
m.page.form( :action=> /email/ )
f = m.page.form( :action=> /email/ )
f.field( :type => /mail/ ).value = 'yormail@example.com'
f.submit()
@takuya
takuya / find
Created February 28, 2018 16:39
# alias の代替にfunction を定義
function find(){
local post=()
local pre=()
local opts=()
local path=''
local mindepth=1
while [[ $1 ]]; do
case "$1" in
-H | -L | -P ) pre+=($1);;
@takuya
takuya / bashrc
Last active February 7, 2018 17:22
alias artisan='php artisan'
. vendor/balping/artisan-bash-completion/artisan
FROM php:7.2.1-fpm-alpine3.7
MAINTAINER takuya-1st
ENV creator=takuya
COPY ./php-fpm.conf /usr/local/etc/php-fpm.d/zzz-99-.$creator.conf
RUN mkdir -p /usr/local/var/run/php-fpm
VOLUME /usr/local/var/run/php-fpm
VOLUME /var/www/html
#!/usr/bin/env python
import sys
import re
import atexit
import inspect
import time
import subprocess
#!/usr/bin/env bash
#
# react to cec keypresses in the jankiest way possible
#
# Author: Dave Eddy <dave@daveeddy.com>
# Date: 10/15/2013
# Licens: MIT
# Tested on: Raspberry pi with libcec compiled from soure
#!/usr/bin/env python
import atexit
import time
import subprocess
import re
class CecClient(object):
#!/usr/bin/env bash
### 補完関数。
_desktop_change(){
curr="${COMP_WORDS[$COMP_CWORD-1]}"
cmd=${COMP_WORDS[0]}
case $COMP_CWORD in
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import urllib.request, urllib.error, urllib.parse
import os, sys, datetime, argparse, re
import subprocess
import base64
import shlex
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import urllib.request, urllib.error, urllib.parse
import os, sys, datetime, argparse, re
import subprocess
import base64
import shlex