Skip to content

Instantly share code, notes, and snippets.

View okwrtdsh's full-sized avatar

okwrtdsh okwrtdsh

View GitHub Profile
./configure \
    --prefix=/usr \
    --localstatedir=/var/lib/vim \
    --with-features=huge \
    --enable-gpm \
    --enable-acl \
    --with-x=yes \
    --enable-gui=gtk2 \
 --enable-multibyte \
zcat -f ./hoge.backup > /tmp/backup_hoge.sql
psql -f /tmp/backup_hoge.sql -d db_name
var xhr = new XMLHttpRequest();
var file;
xhr.open('GET', '/media/upload/order1.pdf');
xhr.onload = function(){
    file = new Blob([xhr.response], {type: "application/pdf"});
}
xhr.send();

//post
#!/bin/bash
declare -A dict
python manage.py showmigrations | (while read line
do
has=`echo "$line" | grep -e "[ ]"`
if [[ $has ]]; then
has_grant=`echo "$line" | grep -e "grant"`
if [[ ! $has_grant ]]; then
dict["$key"]=`echo "$line" | sed -e "s/\[ \] //"`

Androidエミュレータからインターネット接続ができない場合の対処方法

$ adb shell
root@generic_x86:/ # setprop net.dns1 8.8.8.8
root@generic_x86:/ # setprop net.dns2 8.8.4.4

http://miblog.guruguruheadslab.com/archives/67

posgresql 9.5.4 to 9.6.1

launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
mv /usr/local/var/postgres /usr/local/var/postgres954
brew update
brew upgrade postgresql
initdb /usr/local/var/postgres -E utf8
pg_upgrade -b /usr/local/Cellar/postgresql/9.5.4_1/bin -B /usr/local/Cellar/postgresql/9.6.1/bin -d /usr/local/var/postgres954 -D /usr/local/var/postgres
cp /usr/local/Cellar/postgresql/9.6.1/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
import json
from django.views.generic import FormView, TemplateView
from django_cbv_utils.views import JSONResponseMixin
class GoogleChartMixin(object):
chart_type = 'ColumnChart'
header = None
options = None
@okwrtdsh
okwrtdsh / ubuntu1604_remote_desktop.md
Last active May 2, 2017 02:32
ubuntu1604_remote_desktop.md

install opencv2

http://qiita.com/sheep6box/items/37fb63c41d93c088013a

$ sudo apt-get -y install libopencv-dev build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff4-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev libqt4-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip
$ sudo apt-get -y install build-essential libopenexr-dev python-tk libtbb-dev libeigen3-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-common texlive-latex-extra default-jdk ant libvtk5-qt4-dev unzip
$ sudo apt-get -y install libdc1394-22-dev libdc1394-22 libdc1394-utils