Skip to content

Instantly share code, notes, and snippets.

View tobynet's full-sized avatar

tobynet tobynet

  • Toyama, Japan
View GitHub Profile
@tobynet
tobynet / script.babel
Created September 7, 2017 20:12
this.in.JS
// Codepen inserts 'use strict' in head!!
// Error
//this.poop = '💩';
//console.log(`[top] this.poop: ${poop}`);
const Foo = function f() {
this.poopInF = '💩inFunc';
console.log(`[f()] this.poopInF: ${this.poopInF}`);
}
@tobynet
tobynet / index.html
Created September 5, 2017 20:38
The order of events by mouse or touch
<h1>TouchEvent と MouseEventの同時使用テスト</h1>
<p>Push F12 to open console and to read event logs.</p>
<p>
<a id="javabo" class="redjavabo" href="javascript:void(0);" draggable="false">
無料タッチイベント と マウスイベントのテスト
</a>
</p>
<form>
@tobynet
tobynet / Stretch background image.markdown
Created May 12, 2016 07:14
Stretch background image
@tobynet
tobynet / file0.txt
Last active March 22, 2016 08:55
PC不要!スマートフォンから始めるProlog ref: http://qiita.com/toby_net/items/1f4cb7c780b136ca1552
?- 人間(X).
@tobynet
tobynet / tw-length.rb
Created August 8, 2013 01:40
TwLength: Irresponsible message length calculator for posting twitter
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# Implements
module TwLength
# ref. https://dev.twitter.com/docs/api/1.1/get/help/configuration
# Someone help me with getting twitter configuration without oAuth? ;(
#
# RESERVED_LENGTH.must_eqal [short_url_length_http, short_url_length_https].max
MAX_RESERVED_LENGTH = 23
@tobynet
tobynet / add-separator-each-commands.zsh
Created June 7, 2013 13:35
Add separating line between commands on zsh. zshでコマンドを実行したら、次のプロンプトの前に区切り線を出して、コマンドとコマンドの間を見易くするやつ。~/.zshrcなどにコピペして使う。
# Add separating line between commands
# cf. oh-my-zsh af-magic theme https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/af-magic.zsh-theme
if [[ ! ( $PROMPT =~ '-----------------------------------------' ) ]]; then
PROMPT='$FG[237]------------------------------------------------------------%{$reset_color%}
'"$PROMPT"
fi
@tobynet
tobynet / file0.txt
Last active December 16, 2015 22:17
vagrant において、明示的に VirtualBox の機能(vboxsf)を使いフォルダを同期するには、`config.vm.synced_folder ".", "/vagrant", type: "virtualbox"` のように Vagrantfile に設定するとよい ref: http://qiita.com/toby_net/items/6eb74471871ab9fba087
# インストール
> vagrant plugin install vagrant-vbguest
# 確認
> vagrant plugin list
:
vagrant-vbguest (0.11.0)
:
@tobynet
tobynet / suppress_ctrl-q_on_ubuntu-12.04desktop.sh
Last active December 11, 2015 20:18
Suppress unintentionally closing application by Ctrl+Q on Ubuntu 12.04 desktop.
#!/bin/bash
# 概要: Ubuntu 12.04 デスクトップ上で、Ctrl+Qにて意図せずアプリケーションが終了されてしまうのを防ぐ
# 必要: $ sudo apt-get install gconf2
# 確認方法: $ gconftool-2 -a /desktop/gnome/keybindings/$KEYBINDING_KEY
# 注意点: 誤ってキーが押されたら notify-send で通知しているので、邪魔なら外してください
KEYBINDING_KEY=custom100
if [[ -z "$(gconftool-2 -a /desktop/gnome/keybindings/$KEYBINDING_KEY)" ]] ; then
gconftool-2 --set --type string /desktop/gnome/keybindings/$KEYBINDING_KEY/name 'unintentionally Ctrl+Q killer'
@tobynet
tobynet / cakesgetter.py
Last active December 11, 2015 06:48 — forked from laiso/cakesgetter.py
ツイッター検索からcakes無料時間の記事を探してダウンロードしておくスクリプト
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
cakegetter.py
ツイッター検索からcakes無料時間の記事を探してダウンロードしておくスクリプト
"""
import os
import re