Skip to content

Instantly share code, notes, and snippets.

View dhandeo's full-sized avatar

Dhanannjay (D'jay) Deo dhandeo

View GitHub Profile

Copy and paste within tmux

  1. enter copy mode using Control+b [
  2. navigate to beginning of text, you want to select and hit Control+Space
  3. move around using arrow keys to select region
  4. when you reach end of region simply hit Alt+w to copy the region
  5. now Control+b ] will paste the selection
@lost-theory
lost-theory / gist:3772472
Created September 23, 2012 17:48
upload file with flask test client
import unittest
from app import app
from cStringIO import StringIO
class UploadTest(unittest.TestCase):
def setUp(self):
self.app = app
self.app.config['TESTING'] = True
self.client = self.app.test_client()
@jaytaylor
jaytaylor / camel_case_to_snake_case.py
Created September 6, 2012 21:41
Convert camel-case to snake-case in python.
#!/usr/bin/env python
"""
Convert camel-case to snake-case in python.
e.g.: CamelCase -> snake_case
Relevant StackOverflow question: http://stackoverflow.com/a/1176023/293064
"""