(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
#!/usr/bin/env python | |
# found on <http://files.majorsilence.com/rubbish/pygtk-book/pygtk-notebook-html/pygtk-notebook-latest.html#SECTION00430000000000000000> | |
# simple example of a tray icon application using PyGTK | |
import gtk | |
def message(data=None): | |
"Function to display messages to the user." | |
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
# REF: http://www.quora.com/How-do-I-create-and-update-embedded-documents-with-MongoEngine | |
class Comment(EmbeddedDocument): | |
content = StringField() | |
name = StringField(max_length=120) | |
class Post(Document): | |
title = StringField(max_length=120, required=True) | |
author = StringField(required=True) |
"""python-mailer.py | |
Author : Vishnu Ashok | |
Contact : thisisvishnuashok@gmail.com | |
thisisvishnuashok@hotmail.com | |
GitHub : http://github.com/p53ud0k0d3 | |
This is a simple email client program, which can be used to send emails from Gmail and Hotmail. | |
You must enable "Allow less secure apps" in Gmail settings. | |
""" |
Because pointers can be ugh
To understand a pointer, let's review "regular" variables first. If you're familiar with a programming language without pointers like JavaScript, this is what you think when you hear "variable".
When declaring a variable by identifier (or name), the variable is synonymous with its value.
%.hex: %.asm | |
avra -fI $< | |
rm *.eep.hex *.obj *.cof | |
all: $(patsubst %.asm,%.hex,$(wildcard *.asm)) | |
upload: ${program}.hex | |
avrdude -c arduino -p m328p -P /dev/arduino-uno -b 115200 -U flash:w:$< | |
monitor: |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import json | |
from flask import Flask, url_for | |
from flask_sqlalchemy import SQLAlchemy | |
""" | |
Flask-SQLAlchemy many-to-many relationship using helper table | |
http://flask-sqlalchemy.pocoo.org/2.1/models/ | |
Hippies love their dogs. |
#!/bin/bash | |
# This script is intended to make switching between laptop and external displays easier when using i3+dmenu | |
# To run this script, map it to some shortcut in your i3 config, e.g: | |
# bindsym $mod+p exec --no-startup-id $config/display.sh |