Skip to content

Instantly share code, notes, and snippets.

View informationsea's full-sized avatar

Yasunobu Okamura informationsea

View GitHub Profile
@informationsea
informationsea / checkcredit.py
Last active June 5, 2017 15:31
Check Credit Card log
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import csv
import sqlite3
import sys
import datetime
import pytz
import collections
@informationsea
informationsea / sleepdisplay.c
Last active September 22, 2016 12:36
Lock windows and sleep display
#include <Windows.h>
int main()
{
/* https://msdn.microsoft.com/en-us/library/windows/desktop/aa376869(v=vs.85).aspx */
LockWorkStation();
/* https://msdn.microsoft.com/en-us/library/windows/desktop/ms644944(v=vs.85).aspx */
PostMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 2);
return 0;
}
@informationsea
informationsea / Emacs-25.1-osx-inlinepatch.diff
Created September 18, 2016 15:01
Emacs 25.1 Small IME patch for OS X
diff --git a/configure.ac b/configure.ac
index cd4d1c0..fcc96d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5123,7 +5123,7 @@ case "$opsys" in
## only costs about 1.5K of wasted binary space.
headerpad_extra=1000
if test "$HAVE_NS" = "yes"; then
- libs_nsgui="-framework AppKit"
+ libs_nsgui="-framework AppKit -framework Carbon"
@informationsea
informationsea / qsub-one.sh
Created September 5, 2016 14:39
Support Function for GridEngine
function qsub-one () {
SHOWHELP="false"
GRID_OPTION=("-cwd")
GRID_SHELL="/bin/zsh"
while getopts p:n:m:hs: OPT; do
case $OPT in
"h") SHOWHELP="true";;
"n") GRID_NAME="$OPTARG";;
"m") GRID_OPTION=("${GRID_OPTION[@]}" "-l" "s_vmem=$OPTARG,mem_req=$OPTARG");;
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import sys
LICENSE = '''/*
* hogehoge
* Copyright (C) 2016 NAME
*
@informationsea
informationsea / slidegenerate.groovy
Created February 27, 2016 08:41
Power Point Slide Show Generation Test
@Grab(group='org.apache.poi', module='poi', version='3.13')
@Grab(group='org.apache.poi', module='poi-ooxml', version='3.13')
@GrabExclude(group = 'stax', module = 'stax-api')
@Grab(group='org.apache.poi', module='poi-scratchpad', version='3.13')
import org.apache.poi.sl.usermodel.ShapeType
import org.apache.poi.sl.usermodel.TextParagraph
import org.apache.poi.sl.usermodel.VerticalAlignment
import org.apache.poi.xslf.usermodel.XMLSlideShow
import java.awt.Color
@informationsea
informationsea / vennhelper.R
Created January 29, 2016 04:18
Venn Diagram Helper Function
library(VennDiagram)
venn.quad <- function(g1, g2, g3, g4, category=rep("", 4)) {
draw.quad.venn(length(g1), length(g2), length(g3), length(g4),
length(intersect(g1, g2)), length(intersect(g1, g3)), length(intersect(g1, g4)), length(intersect(g2, g3)), length(intersect(g2, g4)), length(intersect(g3, g4)),
length(intersect(g1, intersect(g2, g3))), length(intersect(g1, intersect(g2, g4))), length(intersect(g1, intersect(g3, g4))), length(intersect(g2, intersect(g3, g4))),
length(intersect(intersect(g1, g2), intersect(g3, g4))),
category=category)
}
#!/bin/bash
source openjdk-common.sh
run mkdir -p $JAVA_BUILD_DIR
export JAVA_HOME=/usr/local/jvm/openjdk-1.8.0_${JAVA_UPDATE}
pushd $JAVA_BUILD_DIR
if [ ! -d rt-8u${JAVA_UPDATE}-b${JAVAFX_BUILDNUM} ]; then
run tar xzf $ARCHIVE_DIR/8u${JAVA_UPDATE}-b${JAVAFX_BUILDNUM}.tar.gz
fi
@informationsea
informationsea / disable-win10-upgrade.reg
Created January 14, 2016 05:25
Disable Windows 10 Upgrade Registory
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate]
"DisableOSUpgrade"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Gwx]
"DisableGwx"=dword:00000001
@informationsea
informationsea / crossthread.c
Created December 29, 2015 04:14
pthread compatible library for windows
/*
* light weight pthread compatible library for Windows
* (C) 2009 Okamura Yasunobu
*/
#include "crossthread.h"
#include <stdio.h>
#ifdef _WIN32