Skip to content

Instantly share code, notes, and snippets.

🌴
On vacation

Hironao OTSUBO motemen

🌴
On vacation
Block or report user

Report or block motemen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View badangular.html
<!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++) {
View docca.rb
#!/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?
View forward2docker.sh
#!/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
View simplehttpserver.Dockerfile
FROM ubuntu
RUN apt-get update
RUN apt-get -y install python
RUN apt-get clean
EXPOSE 8000
CMD [ "python", "-m", "SimpleHTTPServer" ]
@motemen
motemen / Ojisan-Patterns.md
Last active Aug 29, 2015
おじさんパターン集
View Ojisan-Patterns.md
  • その面白そうな話、私も参加していいよね?なぜなら私は無条件に受け入れられているからおじさん(闖入おじさん) #おじさんパターン
  • 後出し難癖おじさん #おじさんパターン
  • 困難は成長のチャンス!だから君たちに成長の機会をあげようおじさん (成長おじさん) #おじさんパターン
  • あらゆる事案に一般論コメントおじさん #おじさんパターン
  • 俺ってあらゆることに精通してるじゃん?だから力になるよおじさん (精通おじさん) #おじさんパターン
@motemen
motemen / hatena-bookmark-count-favicon.user.js
Created Mar 28, 2014
"Hatena Bookmark Count Favicon" userscript
View hatena-bookmark-count-favicon.user.js
// ==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 Aug 29, 2015
Git: checkout "this" (currently shown in Chrome) Pull Request's branch
View git-checkout-this-pr.sh
#!/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, " "),
View adsense-todays-earnings.sh
#!/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
View yukkuri.txt
   _,,....,,_  _人人人人人人人人人人人人人人人_
-''":::::::::::::`''>   ゆっくりしていってね!!!   <
ヽ::::::::::::::::::::: ̄^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 |
You can’t perform that action at this time.