Skip to content

Instantly share code, notes, and snippets.

View kamatari's full-sized avatar
🍎
cool

Masahiro Kamata kamatari

🍎
cool
View GitHub Profile
@kamatari
kamatari / chrome_extension.md
Created May 12, 2013 11:48
chrome extensionをつくるときに参考にしたリンク集
@kamatari
kamatari / knife sub command
Created October 7, 2013 20:46
knife 0.4 available subcommands
** BOOTSTRAP COMMANDS **
knife bootstrap FQDN (options)
** CLIENT COMMANDS **
knife client bulk delete REGEX (options)
knife client create CLIENT (options)
knife client delete CLIENT (options)
knife client edit CLIENT (options)
knife client list (options)
knife client reregister CLIENT (options)
$ which easy_install
$ /usr/bin/easy_install pip
$ sudo /usr/bin/easy_install pip
$ pip install pyflakes
$ sudo pip install pyflakes
$ sudo pip install pep8
$ pyflakes test.py
$ pep8 test.py
@kamatari
kamatari / welcome.md
Last active August 29, 2015 13:57
atom

Welcome to the Atom Beta!

You are one of the first people to use GitHub's new text editor! Here is what you need to know.

  1. Atom is free during the beta period.

  2. If you only remember one thing make it cmd-shift-P. This keystroke toggles the command palette, which lists every Atom command. Yes, you can try it now! Press cmd-shift-P, type markdown and press enter. It will trigger the

$ brew install python
$ brew link python
$ pip install numpy
$ brew tap homebrew/science
$ brew install opencv
$vim .zprofile
>> export PYTHONPATH=/usr/local/Cellar/opencv/2.4.9/lib/python2.7/site-packages:$PYTHONPATH
+ check >>
<?php
$url = "http://31.media.tumblr.com/tumblr_mc4u6lwZHr1qf4k86o1_500.jpg";
$img_string = file_get_contents($url);
$img_data = imagecreatefromstring($img_string);
// make color
$gd = imagecreatetruecolor(1,1);
$red = imagecolorallocate($gd, 255, 0, 0);
// drawing
'''
usage:
python show_camera_or_video.py
or
python show_camera_or_video.py cam
or
python show_camera_or_video.py inputfilename.avi
'''
import numpy as np
import cv2
# built-in module
import sys
if __name__ == '__main__':
print __doc__
try:
@kamatari
kamatari / cmake_error
Created September 26, 2014 06:17
install failed log of opencv
[ 67%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/test_core.cpp.o
[ 67%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/test_warp_affine.cpp.o
[ 67%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/test_resize.cpp.o
[ 67%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/test_remap.cpp.o
[ 67%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/test_hough.cpp.o
Linking CXX executable ../../bin/opencv_test_gpu
[ 67%] Built target opencv_test_gpu
[ 67%] Generating opencv_ocl_pch_dephelp.cxx
Scanning dependencies of target opencv_ocl_pch_dephelp
[ 67%] Building CXX object modules/ocl/CMakeFiles/opencv_ocl_pch_dephelp.dir/opencv_ocl_pch_dephelp.cxx.o
<?php
$size = getimagesize('http://free-photos-ls01.gatag.net/images/lgf01a201304271400.jpg');
var_export($size);
/* output
array (
0 => 1024,
1 => 768,
2 => 2,
3 => 'width="1024" height="768"',