This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo hello world | |
echo user: ${HOME} | |
echo pwd: ${PWD} | |
echo shell: ${SHELL} | |
echo variable: ${x} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case ${1} in | |
init) | |
cat /etc/yum.conf /data/yum.conf.bak | |
cat /etc/yum.conf | sed 's/cachedir=.*/cachedir=\/opt\/yum-cache/' | sed 's/keepcache=0/keepcache=1/' > /tmp/yum.conf | |
cp /tmp/yum.conf /etc/yum.conf | |
yum makecache | |
yum update -y | |
yum install -y epel-release | |
yum install -y "@Development Tools" | |
yum install -y bash-completion bash-completion-extra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var messageHistory = []; var els = document.body.querySelectorAll('yt-live-chat-text-message-renderer'); Array.from(els).filter(el => Array.from(messageHistory).filter(message => message.getAttribute('id') === el.getAttribute('id')).length === 0).map(el => { messageHistory.push(el); return el.querySelector('#message').textContent }); | |
var messageHistory = []; | |
var src = 'http://static.junmakii.umu.us/bell.ogg'; | |
var audioEl = document.createElement('audio'); | |
audioEl.setAttribute('src', src); | |
let play = function () { | |
let el = audioEl.cloneNode(true); | |
el.play(); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[aliases] | |
test=pytest | |
[tool:pytest] | |
doctest_plus = enabled | |
addopts = --ignore=env --doctest-modules | |
#--ignore-toplevel=setup.py | |
testpaths=mypkg | |
norecursedirs=lib include .tox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(run-at-time nil (* 5 60) 'recentf-save-list) | |
(setq recentf-max-saved-items 200 | |
recentf-max-menu-items 15) | |
(recentf-mode +1) | |
; In markdown-mode, Press <TAB> on a ### line. | |
(windmove-default-keybindings (kbd "S")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(run-at-time nil (* 5 60) 'recentf-save-list) | |
(setq recentf-max-saved-items 200 | |
recentf-max-menu-items 15) | |
(recentf-mode +1) | |
; In markdown-mode, Press <TAB> on a ### line. | |
(windmove-default-keybindings (kbd "S")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
$ gunicorn -k tornado junmakii_test_tornado_with_gunicorn:app | |
""" | |
import tornado.web | |
import tornado.wsgi | |
import tornado.web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tornado.web | |
import tornado.wsgi | |
import tornado.web | |
class AppHandler(tornado.web.RequestHandler): | |
def initialize(self, queue): | |
self.queue = queue | |
def get(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
def encode_object_and_list(data, encoding='utf=8'): | |
""" | |
:rtype: Union[list, tuple, dict] | |
>>> encode_object_and_list({u"name": u"James"}) | |
{'name': 'James'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""A image utility function to keep image aspect ratio. | |
""" | |
def get_size(im_size, size): | |
""" | |
:rtype: (int, int) | |
>>> get_size((360, 100), (360, 180)) | |
(648, 180) |
NewerOlder