Skip to content

Instantly share code, notes, and snippets.

View laminko's full-sized avatar
...

La Min Ko laminko

...
View GitHub Profile
import tornado.httpserver, tornado.ioloop, tornado.options, tornado.web, os.path
from tornado.options import define, options
define("port", default=8888, help="run on the given port", type=int)
class Application(tornado.web.Application):
def __init__(self):
handlers = [
(r"/", HomeHandler),
(r"/upload", UploadHandler)
@nephics
nephics / client.py
Created August 9, 2011 19:33
Test of experimental Tornado feature for a streaming request body handler
#
# Test of experimental Tornado feature for a streaming request body handler, see
# https://github.com/nephics/tornado/commit/1bd964488926aac9ef6b52170d5bec76b36df8a6
#
#
# Client sending file to server
#
import tornado.httpclient as httpclient
@mbj
mbj / config
Created January 13, 2012 12:35
systemctl status check
radon# cat /etc/systemd/system/mongodb.service
[Unit]
Description=MongoDB Server
Wants=network.target
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/mongod --config /etc/mongodb.conf
User=mongodb
@bootandy
bootandy / tornado_mongo.py
Last active December 15, 2016 17:49
Very simple sample code of tornado and mongodb
from datetime import datetime
from pymongo.connection import Connection
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
from tornado.options import define, options
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 4, 2024 06:56
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@asabaylus
asabaylus / gist:3071099
Created July 8, 2012 14:12
Github Markdown Heading Anchors

Anchors in Markdown

To create an anchor to a heading in github flavored markdown. Add - characters between each word in the heading and wrap the value in parens (#some-markdown-heading) so your link should look like so:

[create an anchor](#anchors-in-markdown)

@mbostock
mbostock / .block
Last active October 10, 2019 18:06
Progress Events
license: gpl-3.0
redirect: https://observablehq.com/@mbostock/fetch-progress
@mattratleph
mattratleph / vimdiff.md
Last active June 21, 2024 15:33 — forked from roothybrid7/vimdiff_cheet.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)