Skip to content

Instantly share code, notes, and snippets.

View usuyama's full-sized avatar
🎾

Naoto Usuyama usuyama

🎾
View GitHub Profile
@torus
torus / command-key-on-nodoka.md
Created October 3, 2010 06:52
のどかで、Mac みたいなキーバインドを実現する。

のどかで、Mac みたいなキーバインドを実現する。

Ctrl キーは、Emacs 的なキーバインド。

Windows キーは、オリジナルの Windows での Ctrl キーのように振舞う。

Windows キーと Ctrl キーを区別するために、 Ctrl キーについては mod0 という新しいモディファイアとして扱うようにして、 emacsedit.nodoka ファイルを修正して、C- となっている部分をすべて M0- に置き換えた。

@arq5x
arq5x / dbsnp-to-bed.sh
Created March 7, 2011 23:19
Make a BED file from the raw UCSC file
export GENOME=hg19
export SNPBUILD=131
curl -s http://hgdownload.cse.ucsc.edu/goldenPath/$GENOME/database/snp$SNPBUILD.txt.gz | \
zcat | \
cut -f 2,3,4,5,6,7,10,16 > dbsnp.$SNPBUILD.$GENOME.bed
head dbsnp.$SNPBUILD.$GENOME.bed
chr1 10433 10433 rs56289060 0 + -/C near-gene-5
chr1 10491 10492 rs55998931 0 + C/T near-gene-5
chr1 10518 10519 rs62636508 0 + C/G near-gene-5
@usuyama
usuyama / qsub_and_wait.sh
Created June 2, 2012 03:34
qsub and check qstat
#!/bin/bash
#$ -S /bin/bash
#$ -cwd
job_id=$(qsub $@ | ruby -ane 'print $F[2]')
while true
do
is_exist=$(qstat | ruby -ane "print 1 if \$F.first == '$job_id'")
if [ -z "$is_exist" ];then
break
@Danik
Danik / capslock_remap_alt.ahk
Last active May 4, 2024 05:16
Autohotkey Capslock Remapping Script. Makes Capslock function as a modifier key to get cursor keys etc. on the left side of the keyboard, so you never have to move your hand to the right.
; Autohotkey Capslock Remapping Script
; Danik
; More info at http://danikgames.com/blog/?p=714
; danikgames.com
;
; Functionality:
; - Deactivates capslock for normal (accidental) use.
; - Hold Capslock and drag anywhere in a window to move it (not just the title bar).
; - Access the following functions when pressing Capslock:
; Cursor keys - J, K, L, I
@urschrei
urschrei / basemap_descartes.py
Last active November 6, 2020 02:49
How to plot Shapely Points using Matplotlib, Basemap, and Descartes
"""
required packages:
numpy
matplotlib
basemap: http://matplotlib.org/basemap/users/installing.html
shapely: https://pypi.python.org/pypi/Shapely
descartes: https://pypi.python.org/pypi/descartes
random
@antonlindstrom
antonlindstrom / spark-wordcount-sorted.py
Created March 13, 2014 16:47
Spark Wordcount Job that lists the 20 most frequent words
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@luiscape
luiscape / install_packages.sh
Created January 16, 2017 14:36
Install Python dependency packages from requirements.txt using conda.
#
# Original solution via StackOverflow:
# http://stackoverflow.com/questions/35802939/install-only-available-packages-using-conda-install-yes-file-requirements-t
#
#
# Install via `conda` directly.
# This will fail to install all
# dependencies. If one fails,
# all dependencies will fail to install.
@rverton
rverton / chrome_headless_screenshot.py
Created July 10, 2017 08:53
Make a screenshot with a headless google chrome in python
# Install chromedriver from https://sites.google.com/a/chromium.org/chromedriver/downloads
import os
from optparse import OptionParser
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
CHROME_PATH = '/usr/bin/google-chrome'
@kaityo256
kaityo256 / howto.md
Last active May 20, 2024 11:32
研究者として生きていくコツ

研究者として生きていくコツ

これは卜部さんの優秀なプログラマーになるためのコツに影響されて書いたものです。

著者について

自分を構成する要素は、大きい順にシステムエンジニア、プログラマ、研究者だと思っています。でも、おそらく給料は「研究者」として払われているため、研究者として生きていくコツとしました。僕はさほど優秀とは言えませんが、とりあえずそれなりに長いことそれで食っています。大学の教授のウェブサイトに「研究者としてのコツ」みたいなことが書いてあることがありますが、これには「既に大学の教授になっている人が書いている」という強烈なバイアスがかかっています。もちろん参考になることも書いてありますが、「死ぬほど研究しろ、研究のことだけ考えろ」的な文章が多い印象です。これは普通の人にとって役に立たない助言です。これは平均的な研究者として生きていくための戯言、ポエムだと思ってください。

健康第一

@usuyama
usuyama / launch_tensorboard_azureml.py
Last active June 3, 2020 19:32
Tensorboard with AzureML
'''
https://docs.microsoft.com/en-us/azure/machine-learning/how-to-monitor-tensorboard
make sure to install
pip install tensorflow azureml-tensorboard
Tensorboard logs need to be written in the logs folder by AML training runs.
SummaryWriter(log_dir="logs/test_run")
'''