Skip to content

Instantly share code, notes, and snippets.

View motemen's full-sized avatar
🌴
On vacation

Hironao OTSUBO motemen

🌴
On vacation
View GitHub Profile
<!DOCTYPE html>
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.js"></script>
<script>
// 10 $digest() iterations reached. Aborting!
function MainCtrl ($scope) {
$scope.numRepeat = 1;
$scope.gen = function () {
for (var a = [], i = 0; i < $scope.numRepeat; i++) {
#!/usr/bin/env ruby
require 'json'
def run(*args, &block)
STDERR.puts "Run: #{args}"
if block_given?
out = %x(#{args.join(' ')})
raise $?.to_s unless $?.success?
#!/bin/sh
# Easily build and start a docker container and set up port forwardings to it
# (by default EXPOSE-ed port + 10000)
# % ./forward2docker <path to Dockerfile>
set -e
dockerfile=$1
FROM ubuntu
RUN apt-get update
RUN apt-get -y install python
RUN apt-get clean
EXPOSE 8000
CMD [ "python", "-m", "SimpleHTTPServer" ]
lazy val root = project in file(".")
lazy val tasks = project in file("tasks") dependsOn(root)
@motemen
motemen / hatena-bookmark-count-favicon.user.js
Created March 28, 2014 04:58
"Hatena Bookmark Count Favicon" userscript
// ==UserScript==
// @name Hatena Bookmark Count Favicon
// @namespace http://motemen.github.io/
// @match http://b.hatena.ne.jp/entry/*
// @match http://api.b.st-hatena.com/*
// ==/UserScript==
(function () {
var style = window.getComputedStyle(document.querySelector('ul.entry-data li.category a'));
@motemen
motemen / git-checkout-this-pr.sh
Last active August 29, 2015 14:03
Git: checkout "this" (currently shown in Chrome) Pull Request's branch
#!/bin/sh
set -e
chrome-cli execute '(function () {
return [
location.hostname,
location.pathname.split("/")[1],
location.pathname.split("/")[2],
$.trim($(".gh-header-title").text()).replace(/\n\s*/g, " "),
#!/bin/sh
cache_file="$0.cache"
if [ -n "$(find $cache_file -mtime -30m)" ]; then
cat $cache_file
else
earnings=$(adsense-report-cli -no-header -from=today | cut -f2)
echo "¥ $earnings" | tee $cache_file
fi
   _,,....,,_  _人人人人人人人人人人人人人人人_
-''":::::::::::::`''>   ゆっくりしていってね!!!   <
ヽ::::::::::::::::::::: ̄^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^ ̄
 |::::::;ノ´ ̄\:::::::::::\_,. -‐ァ     __   _____   ______
 |::::ノ   ヽ、ヽr-r'"´  (.__    ,´ _,, '-´ ̄ ̄`-ゝ 、_ イ、
_,.!イ_  _,.ヘーァ'二ハ二ヽ、へ,_7   'r ´          ヽ、ン、
::::::rー''7コ-‐'"´    ;  ', `ヽ/`7 ,'==─-      -─==', i
r-'ァ'"´/  /! ハ  ハ  !  iヾ_ノ i イ iゝ、イ人レ/_ルヽイ i |
!イ´ ,' | /__,.!/ V 、!__ハ  ,' ,ゝ レリイi (ヒ_]     ヒ_ン ).| .|、i .||
`!  !/レi' (ヒ_]     ヒ_ン レ'i ノ   !Y!""  ,___,   "" 「 !ノ i |
@motemen
motemen / gist:2074
Created July 24, 2008 07:41
Wizardry #1
+-+-+-+-+-+-+-----+-+ +-+-----------+-+-+
| |.| |.| |. . .|.'.|.'. .'. .'. .|.|.|
+---+'+-+'+-+ +-+ | |'+'+---+ +'+'|
|. .'. . . .'. . .|. .|.|.|.|. .|. .|. .|
|'+-+'+ +---+ | | +-+-+--'----+ +
|.| |.|.| |. . .|. .|.| |.'. .'. .'. .|
+-+-+-+ +---+-+-+'| | | | | +---+---+---+
|. . .|.|. . .| |.|.|.|.| |.| |. .|. .|
| |'| | | +-+ | | | | +-+--'+ |
|. . .'.'. . .| |.| |.|.| |.| |.'. .'. .|