Skip to content

Instantly share code, notes, and snippets.

View yoloseem's full-sized avatar
😼
with cat

Hyunjun Kim yoloseem

😼
with cat
View GitHub Profile
@yoloseem
yoloseem / README.md
Created March 15, 2018 06:04
ec2 ssh

Dependency:

  • boto3 and AWS credential configured on your local
  • colored

Usage:

  • $ python ech.py server-name

More simple usage:

@yoloseem
yoloseem / radio_sections.json
Created April 19, 2016 09:35
/radio/sections/
{
"meta": {
"result_size": 9
},
"result": [
{
"_type": "radio_section",
"name": "내 채널",
"section_type": "mychannel",
"channels": [
@yoloseem
yoloseem / failing.svg
Last active December 23, 2015 09:50
build status badge SVGs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yoloseem
yoloseem / fabutils.py
Created September 25, 2013 13:47
supervisor control with fabric.
""" fabutils.py
~~~~~~~~~~~
"""
from __future__ import absolute_import, unicode_literals
import re
import time
from fabric.api import quiet, run, settings, sudo
from fabric.utils import abort, error, puts, warn
@yoloseem
yoloseem / .vimrc
Created August 29, 2013 08:16
My .vimrc file.
"vImproved
set nocompatible
"Syntax Highlighting
syntax on
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
@yoloseem
yoloseem / po2json.py
Last active December 21, 2015 04:39
PO-to-JSON Distutils/Setuptools Command Integration
""" :mod:`po2json`
~~~~~~~~~~~~~~
Convert PO files to JSON-serialized files.
By Hyunjun Kim <[email protected]> for StyleShare.
Skeleton source code from `babel.messages.frontend.compile_catalog` that does compiling PO to MO files.
"""
@yoloseem
yoloseem / Vagrantfile
Last active December 18, 2015 04:49 — forked from dlutzy/gist:2469037
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
boxes = [
{ :name => :web,
:role => 'web',
:ip => '192.168.33.1',
:http_fwd => 8080,
:shares => true },
{ :name => :db,
@yoloseem
yoloseem / htmlfill.py
Last active December 15, 2015 22:59
Jinja2 htmlfill Extension
"""Jinja2 x htmlfill
Known bugs: Can't skip empty dictionaries when htmlfilling is not needed.
# AUTHOR: HYUNJUN KIM <[email protected]>
# LICENSE: Distributed under MIT License.
"""
import formencode.htmlfill
import jinja2
Credential.user_id = Column(..., ForeignKey('credentials.id', ...)
Credential.user = relationship('User')
---
User.credentials = relationship('Credential', lazy='dynamic')
---
>>> print user.credentials
@yoloseem
yoloseem / gist:4595277
Last active December 11, 2015 11:38 — forked from dahlia/gist:4407166
formencode htmlfill in jinja2 template
# htmlfill
with app.test_request_context('/'):
html = render_template_string('''
{%- autoescape true -%}
{%- form 'user.signin', {'method': 'POST'}
with {'name': 'sohee', 'pretty': 'no'},
{'pretty': 'sohee is always pretty.'} -%}
<input type="text" name="name" /> {{- '' -}}
<input type="text" name="pretty" placeholder="yes" /> {{- '' -}}
<div id="errors"> {{- '' -}}