Skip to content

Instantly share code, notes, and snippets.

View Superbil's full-sized avatar
:shipit:
Working in Cloud

Superbil Superbil

:shipit:
Working in Cloud
View GitHub Profile
@Superbil
Superbil / dict.py
Last active March 10, 2016 09:38
lookup word on Mac's Dictionary in Emacs
#!/usr/bin/env python
'''
must intall PyObjC, pyobjc-framework-DictionaryServices
source from http://sakito.jp/mac/dictionary.html
'''
import sys
from DictionaryServices import *
#!/usr/bin/env python
import os, os.path
import glob
import shutil
def build(target, output_dir):
"builds tracker for device or simulator"
t = target.lower()
@Superbil
Superbil / Navy_Fleet.py
Last active December 13, 2015 23:28
find ship by Navy Fleet
#!/usr/bin/env ipython
# author: superbil
# define values
map_size = 7
small_limit = 3
middle_limit = 2
bigger_limit = 1
# create map
@Superbil
Superbil / python.lisp
Last active December 13, 2015 22:29
python on emacs
;; python setup
(setq python-check-command "pyflakes")
;; python-mode setup
(autoload 'python-mode "python-mode" "Python editing mode." t)
;; load pymacs
(eval-after-load "python-mode"
'(progn
(require 'pymacs)
#!/usr/bin/env python
def create_data_from_csv(file_name):
arr = []
with open('0209.csv', 'rb') as f:
r = csv.reader(f)
for row in r:
t = []
for i in row:
t.append(int(i))
@Superbil
Superbil / RunEmacsWithDebugger.scpt
Last active December 11, 2015 02:09
run emacs lisp debugger, that can debugger init file Note: I use homebrew's emacs
try
do shell script "open -a `/usr/local/bin/brew --prefix emacs`/Emacs.app --args --debug-init"
on error errMsg
display dialog "homebrew or emacs not installed"
end try
@Superbil
Superbil / ipython_config.py
Created January 9, 2013 07:34
my ipython config
# Configuration file for ipython.
c = get_config()
# set editor to emacs
c.InteractiveShell.editor = 'emacsclient -c'
c.IPythonWidget.editor = 'emacsclient -c'
# Dont' confirm when exit
c.TerminalInteractiveShell.confirm_exit = False
@Superbil
Superbil / find_face_by_video.py
Created January 9, 2013 04:06
use OpenCV API to find face from video steam
#!/usr/bin/env python
import cv
import cv2
window_name = "preview"
load_model = "haarcascade_frontalface_default.xml"
cv2.namedWindow(window_name)
vc = cv2.VideoCapture(0)
@Superbil
Superbil / find_face.py
Created January 9, 2013 04:03
use openCV API to find face test on openCV 2.4.3
#!/usr/bin/env python
load_model = "haarcascade_frontalface_default.xml"
import sys
image_path = sys.argv[1]
# cv api 1
import cv
img = cv.LoadImage(image_path)
@Superbil
Superbil / mount_folderOnHost.scpt
Last active October 20, 2015 07:18
try to mount folderOnHost on OSX
try
mount volume "smb://account@host/folderOnHost"
end try