Skip to content

Instantly share code, notes, and snippets.

@reddypdl
reddypdl / 0_reuse_code.js
Last active August 29, 2015 14:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
import pytest
from random import randint
import logging
import pickle
logging.basicConfig(filename="log.log", level=logging.INFO)
class App(object):
def __init__(self):
self.a = randint(0, 100)
# -*- coding: utf-8 -*-
"""
amazon_sender.py
~~~~~~~~
Python helper class that can send emails using Amazon SES and boto.
The biggest feature of this class is that encodings are handled properly.
It can send both text and html emails.
This implementation is using Python's standard library (which opens up for a lot more options).
@reddypdl
reddypdl / queueget.py
Last active August 29, 2015 14:16 — forked from baijum/queueget.py
import socket
HOST, PORT = "localhost", 9999
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
sock.connect((HOST, PORT))
sock.send("get" + "\n")
@reddypdl
reddypdl / conftest.py
Last active August 29, 2015 14:16 — forked from baijum/conftest.py
import time
import pytest
def pytest_configure_node(node):
node.slaveinput['all_nodes'] = {'a': True, 'b': True, 'c': True}
node.slaveinput['used_nodes'] = {}
def _get_browser(request):
def get_browser():
class Browser(object):
@reddypdl
reddypdl / pyclip.py
Last active August 29, 2015 14:16 — forked from baijum/pyclip.py
import win32clipboard, win32con
def get_pattern():
text = str(eval(raw_input("Pattern:\n")))
win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardText(text)
win32clipboard.CloseClipboard()
;;; python-pep8.el --- minor mode for running `pep8'
;; Copyright (c) 2009, 2010 Ian Eure <ian.eure@gmail.com>
;; Author: Ian Eure <ian.eure@gmail.com>
;; Keywords: languages python
;; Last edit: 2010-02-12
;; Version: 1.01