Skip to content

Instantly share code, notes, and snippets.

View tomoh1r's full-sized avatar
💭
I may be slow to respond.

NAKAMURA, Tomohiro tomoh1r

💭
I may be slow to respond.
View GitHub Profile
@mzp
mzp / nexus7.md
Last active December 26, 2015 16:19

Nexus7買いました

あるいは、Nexus7上にDebian環境を構築するときのメモ。

TODO

だれかおしえてください。

  • キーボードの配列変更(Dvorak配列 + Ctrl-CapsLock入れ替え)
  • 画面幅が80文字に固定される
  • スワップを有効にしたほうがいい?
let s:endpoint = 'http://services.gingersoftware.com/Ginger/correct/json/GingerTheText'
let s:apikey = '6ae0c3a0-afdc-4532-a810-82ded0054236'
function! s:ginger(text)
let res = webapi#json#decode(webapi#http#get(s:endpoint, {
\ 'lang': 'US',
\ 'clientVersion': '2.0',
\ 'apiKey': s:apikey,
\ 'text': a:text}).content)
let i = 0
let correct = ''
@P7h
P7h / IntelliJ_IDEA__Perf_Tuning.txt
Last active March 22, 2024 20:18
Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
@mattbornski
mattbornski / stdout.py
Created August 8, 2012 21:41
Streaming stdout from a Python subprocess in Python 2.6-2.7
#!/usr/bin/env python
# I was frustrated that no matter what buffer setting I passed to communicate,
# I could not get stdout from my subprocess until the process had completed.
# I googled around and came up with this, which illustrates the problem and a
# solution.
# http://stackoverflow.com/questions/2804543/read-subprocess-stdout-line-by-line
# http://bugs.python.org/issue3907
# http://docs.python.org/library/io.html
@atabary
atabary / dblock.py
Created May 26, 2012 08:45
MySQL table lock with django
#-*- coding: utf-8 -*-
import contextlib
from django.db import connection
@contextlib.contextmanager
def acquire_table_lock(read, write):
'''Acquire read & write locks on tables.
@baali
baali / dlAttachments.py
Created May 8, 2012 08:32
Python script to download all gmail attachments.
# Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail
# Make sure you have IMAP enabled in your gmail settings.
# Right now it won't download same file name twice even if their contents are different.
import email
import getpass, imaplib
import os
import sys
detach_dir = '.'