Skip to content

Instantly share code, notes, and snippets.

View solos's full-sized avatar
🎶
Listening music

solos

🎶
Listening music
View GitHub Profile
@solos
solos / aliases
Created February 3, 2014 12:47 — forked from kaleb/aliases
#~/.mutt/aliases
alias nick Nicholas Levandoski <[email protected]>
alias tim Timothy Pitt <[email protected]>
alias steven Steven Jackson <[email protected]>
alias kaleb Kaleb Hornsby <[email protected]>
alias alug-admin nick, tim, steven
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
.DS_Store
*.log
tmp/
// ==UserScript==
// @name 去掉Google搜索跳转
// @namespace Google
// @include https://www.google.co*
// @include http://www.google.co*
// @grant GM_setValue
// @version 1
// ==/UserScript==
document.addEventListener('DOMNodeInserted', checksearch, false);
class Backend(object):
def __init__(self):
engine = create_engine("mysql://{0}:{1}@{2}/{3}".format(options.mysql_user, options.mysql_pass, options.mysql_host, options.mysql_db)
, pool_size = options.mysql_poolsize
, pool_recycle = 3600
, echo=options.debug
, echo_pool=options.debug)
self._session = sessionmaker(bind=engine)
@classmethod
.DS_Store
*.log
tmp/
@solos
solos / vagrant.org
Last active August 29, 2015 14:07 — forked from akiatoji/vagrant.org

Installing CentOS

Download net install iso: CentOS-6.2-x86_64-netinstall.iso

Create a new VirtualBox machine

  • Name: vagrant-centos
  • Operating System: Linux
  • Version: Red Hat
from tornado import gen
import tornado.testing
import motor
class MyTestCase(tornado.testing.AsyncTestCase):
def test_thing(self):
client = motor.MotorClient('localhost', 27017, io_loop=self.io_loop)
client.open_sync()
@solos
solos / dawg.py
Last active August 29, 2015 14:16 — forked from smhanov/dawg.py
#!/usr/bin/python3
# By Steve Hanov, 2011. Released to the public domain.
# Updated 2014 to use DAWG as a mapping.
import sys
import time
DICTIONARY = "/usr/share/dict/words"
QUERY = sys.argv[1:]
# This class represents a node in the directed acyclic word graph (DAWG). It
from concurrent.futures import ThreadPoolExecutor
from functools import partial, wraps
import time
import tornado.ioloop
import tornado.web
EXECUTOR = ThreadPoolExecutor(max_workers=4)