Skip to content

Instantly share code, notes, and snippets.

View ompugao's full-sized avatar

ompugao

View GitHub Profile
@ompugao
ompugao / README.md
Last active February 9, 2019 09:14
scramble joycon standalone
@ompugao
ompugao / mattermost_to_slack.py
Last active April 22, 2024 23:11
message migration from mattermost to slack
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import pprint
import csv
if __name__ == '__main__':
with open('./bulk.csv', 'w') as csvf:
writer = csv.writer(csvf, lineterminator='\n', quoting=csv.QUOTE_ALL)
with open('./bulk.json', 'r') as f:
@ompugao
ompugao / changeslope.py
Created July 30, 2018 07:54 — forked from 8bit-pixies/changeslope.py
Interactive tkinter matlibplot example.
import Tkinter
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.figure import Figure
class App:
def __init__(self, master):
# Create a container
frame = Tkinter.Frame(master)
# Create 2 buttons
self.button_left = Tkinter.Button(frame,text="< Decrease Slope",
@ompugao
ompugao / utmとは
Created September 18, 2017 15:02
utmのやつ
(sifi(aralia(~ (23:54:36))))
@ ipython
iPython 2.7.12 (default, Nov 19 2016, 06:48:10)
Type "copyright", "credits" or "license" for more information.
IPython 2.4.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
@ompugao
ompugao / cute_AA.txt
Created September 18, 2017 14:49 — forked from Tosainu/cute_AA.txt
顔文字詰め合わせ
あせ (・_・;) 顔文字
あせ (・∀・;) 顔文字
あせ (^ω^;;) 顔文字
あせ (゚∀゚ ;)タラー 顔文字
あたふた ヽ(´・ω・`ヽ)​ 顔文字
あつい (。>﹏<)あㄘ”ゅい 顔文字
あつい ι(´Д`υ)アジィー 顔文字
あつい あㄘ”ゅい(>﹏<。Ξ。>﹏<)あㄘ”ゅい 顔文字
あはは ( ゚∀゚)アハハ八八ノヽノヽノヽノ \ / \/ \ 顔文字
あひゃ アヒャヒャヒャ(゚∀゚≡゚∀゚)ヒャヒャヒャ 顔文字
@ompugao
ompugao / not_nn.py
Created June 5, 2017 12:43
keras logistic regression
from keras.models import Sequential
from keras.layers import Dense, Activation
from keras import backend as K
model = Sequential()
model.add(Dense(output_dim = 1, input_dim=2))
model.add(Activation('sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='sgd', metrics=['accuracy'])
test_inputs = [(0, 0), (0, 1), (1, 0), (1, 1)]
#correct_outputs = [False, False, False, True]
@ompugao
ompugao / extend.sh
Last active February 6, 2017 14:19 — forked from wvengen/extend.sh
Extend non-HiDPI external display above HiDPI internal display
#!/bin/sh
# extend non-HiDPI external display on DP* above HiDPI internal display eDP*
# see also https://wiki.archlinux.org/index.php/HiDPI
# you may run into https://bugs.freedesktop.org/show_bug.cgi?id=39949
# https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/883319
EXT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v '^eDP' | head -n 1`
INT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v '^DP' |grep -v 'HDMI' | head -n 1`
ext_w=`xrandr | sed 's/^'"${EXT}"' [^0-9]* \([0-9]\+\)x.*$/\1/p;d'`
@ompugao
ompugao / blinkyoureyes.py
Last active November 10, 2016 14:17
a script to protect your eyes from dry-eye.
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = "ompugao"
import sys
from PyQt4 import QtGui, QtCore
class BlinkYourEyesWidget(QtGui.QWidget):
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@ompugao
ompugao / vim.md
Created January 20, 2016 10:55
vim tips

実践Vim

先頭に連番をつける

:let i=1
qa
I<c-r>=i<CR><Esc>j
:let i+=1
q