Skip to content

Instantly share code, notes, and snippets.

Masaaki Shibata emptypage

Block or report user

Report or block emptypage

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@emptypage
emptypage / Makefile
Last active Aug 29, 2015
Makefile to build wxWidgets for MS Windows.
View Makefile
# Makefile to build wxWidgets for MS Windows.
!IFDEF WX
INSTALL_DIR = $(WX)
!ELSE IFNDEF INSTALL_DIR
INSTALL_DIR = C:\wxWidgets
!ENDIF
!IFNDEF SRC_DIR
SRC_DIR = wxWidgets
@emptypage
emptypage / Makefile
Last active Aug 29, 2015
Makefile to build OpenSSL DLLs / static libs for MS Windows.
View Makefile
# Makefile to build OpenSSL DLLs / static libs for MS Windows.
!IFDEF OPENSSL
INSTALL_DIR = $(OPENSSL)
!ELSE IFNDEF INSTALL_DIR
INSTALL_DIR = C:\OpenSSL
!ENDIF
!IFNDEF SRC_DIR
SRC_DIR = openssl
@emptypage
emptypage / Makefile
Last active Aug 29, 2015
Makefile to build FreeType 2 DLLs / static libs for MS Windows.
View Makefile
# Makefile to build FreeType 2 DLLs / static libs for MS Windows.
VER_NAME = freetype-2.5.5
GIT_TAG = VER-2-5-5
PLATFORMTOOLSET = v$(VISUALSTUDIOVERSION:.=)
SRC_DIR = freetype2
CD_SRC_DIR = cd $(SRC_DIR)
DIST_BASE = $(VER_NAME)-win32-$(PLATFORMTOOLSET)
@emptypage
emptypage / activate.csh
Last active Aug 29, 2015
Modify activate.csh to enable the OS X framework library under the virtualenv environment. It is also required that you make symlink of /usr/bin/python to venv/bin/python instead of the original which virtualenv copied.
View activate.csh
# This file must be used with "source bin/activate.csh" *from csh*.
# You cannot run it directly.
# Created by Davide Di Blasi <davidedb@gmail.com>.
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; test $?_OLD_PYTHONHOME != 0 && setenv PYTHONHOME "$_OLD_PYTHONHOME" && unset _OLD_PYTHONHOME;unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate && unalias pydoc'
# Unset irrelevant variables.
deactivate nondestructive
setenv VIRTUAL_ENV "/path/to/your/venv"
@emptypage
emptypage / iterlines_backward.py
Created Mar 1, 2015
Iterate lines of the string from its tail to its top.
View iterlines_backward.py
def iterlines_backword(s):
""" Iterate lines of `s` from its tail to its top.
>>> list(iterlines_backword('a'))
['a']
>>> list(iterlines_backword('a\\n'))
['a\\n']
>>> list(iterlines_backword('a\\nb'))
['b', 'a\\n']
@emptypage
emptypage / wx-clock.py
Last active Aug 29, 2015
A wxPython-based sample clock app.
View wx-clock.py
#!/usr/bin/env python
from __future__ import (absolute_import,
division,
print_function,
unicode_literals)
import math
import time
import wx
@emptypage
emptypage / Registry Entries to Customize Keyboard Layout.md
Last active Aug 29, 2015
Registry entries to customize keyboard layout
View Registry Entries to Customize Keyboard Layout.md

Registry Entries to Customize Keyboard Layout

2015-02-27

Caution: these (.reg) files change a registry entry of your PC and will affect its behavior. You should not apply them unless you understand the consequence.

@emptypage
emptypage / new.cmd
Created Feb 15, 2015
A batch to create new file(s) from templates.
View new.cmd
@echo off
setlocal enabledelayedexpansion
set TemplateDir=new-templates
REM # If no args are given, show help (and exit).
if "%1"=="" goto HELP
REM # Options
if /i "%1" == "/?" goto HELP
@emptypage
emptypage / redirect-package.py
Last active Aug 29, 2015
Create hard links / junctions to the system-installed packages in a given virtualenv ("site-packages") directory.
View redirect-package.py
#!/usr/bin/env python
#
# Create hard links / junctions to the system-installed packages in
# a given virtualenv ("site-packages") directory.
#
#
# Background
# ==========
#
# Some libraries such as wxPython do not support pip installation yet.
@emptypage
emptypage / wol.py
Created Aug 17, 2014
Send the magic packet of Wake on LAN
View wol.py
#!/usr/bin/env python
import binascii
import socket
PORT_DEFAULT = 9
IPADDR_DEFAULT = '<broadcast>'
_USAGE = """Usage:
python wol.py [options] <MAC address>...
You can’t perform that action at this time.