Skip to content

Instantly share code, notes, and snippets.

@toumorokoshi
toumorokoshi / keybase.md
Created March 10, 2014 05:43
keybase.md

Keybase proof

I hereby claim:

  • I am toumorokoshi on github.
  • I am yusuketsutsumi (https://keybase.io/yusuketsutsumi) on keybase.
  • I have a public key whose fingerprint is AB8C 894C 0A73 6428 645D 9806 3012 565D 4554 CF56

To claim this, I am signing this object:

# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@toumorokoshi
toumorokoshi / gist:de04b83a8cd29db0e99d
Created July 9, 2014 23:09
Selenium bad cookie example for old IE browsers
from selenium import webdriver
import requests
import multiprocessing
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
REMOTE_URL = "http://USERNAME:CODE@ondemand.saucelabs.com:4444/wd/hub"
OS = ['XP', '7', '8', '8.1']
IE = ['6', '7', '8', '9', '10', '11']
URLS = [
'http://www.google.com',
@toumorokoshi
toumorokoshi / fibonacci.py
Last active December 15, 2015 23:19
An example of how I would answer the fibonacci question,
def fib(n):
assert n > 0, "ERROR: n is less than 0!"
if n == 0:
return 1
curr, prev, results = 1, 0, ['1']
while n > 0:
curr, prev = curr + prev, curr
results.append(str(curr))
n -= 1
return ",".join(results)
@toumorokoshi
toumorokoshi / increment.el
Created April 18, 2013 04:32
Increment and Decrement integers at the cursor
;; check if string is an integer
(defun string-integer-p (string)
(if (string-match "\\`[-+]?[0-9]+\\'" string)
t
nil))
;; Decrement Int
(defun decrement ()
"Decrement the integer that the cursor is on."
(interactive)
@toumorokoshi
toumorokoshi / install.el
Created April 25, 2013 20:24
An example of automated package installation with emacs and package.el
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/") t)
(package-initialize)
(defvar toumorokoshi-packages
'(
ace-jump-mode
@toumorokoshi
toumorokoshi / scraper.py
Created May 15, 2013 00:14
Small scraper for project365photos
from BeautifulSoup import BeautifulSoup
import urllib2
import requests
import re
import os
photo_url_match = re.compile("^http://.*photos.*amazonaws.*photos.*png")
target_directory = "/tmp/"
html = urllib2.urlopen("YOURIPHONEPROJECT_URL_HERE").read()
@toumorokoshi
toumorokoshi / gist:5596276
Last active December 17, 2015 10:39
Non-masochist version of my emacs no externals.
;; Load packages for emacs 24. Keep package-based stuff separate in loadpackages
;; someday I may want a "bare" emacs file
;;(load "~/.emacs.loadpackages")
;;(add-hook 'after-init-hook '(lambda ()
;; (load "~/.emacs.loadpackages")
;; (load "~/.emacs.methods")
;; (load "~/.emacs.elget")
;; (ad-activate 'isearch-search)))
(require 'cl)
@toumorokoshi
toumorokoshi / davinci.cfg
Last active December 17, 2015 17:59
DaVinci sprinter config
[config]
namespace = davinci
[python3]
formula = sprinter.formulas.package
brew = python3
apt-get = python3
[pil]
formula = sprinter.formulas.package
@toumorokoshi
toumorokoshi / gist:1355b6f5f265ffef852c3fb56b76a4c7
Created February 4, 2017 01:10
top and only show specific apps
top -c -p `pgrep -d "," -f "event-tracking"`