start new:
tmux
start new with session name:
tmux new -s myname
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| #!/usr/bin/env python | |
| import dbus | |
| def notify(summary, body='', app_name='', app_icon='', | |
| timeout=5000, actions=[], hints=[], replaces_id=0): | |
| bus_name = 'org.freedesktop.Notifications' | |
| object_path = '/org/freedesktop/Notifications' | |
| interface_name = bus_name |
| #!/bin/bash | |
| # | |
| # Watch current directory (recursively) for file changes, and execute | |
| # a command when a file or directory is created, modified or deleted. | |
| # | |
| # Written by: Senko Rasic <senko.rasic@dobarkod.hr> | |
| # | |
| # Requires Linux, bash and inotifywait (from inotify-tools package). | |
| # | |
| # To avoid executing the command multiple times when a sequence of |
| #!/usr/bin/env python | |
| import sys | |
| import os | |
| def restart_program(): | |
| """Restarts the current program. | |
| Note: this function does not return. Any cleanup action (like | |
| saving data) must be done before calling this function.""" | |
| python = sys.executable | |
| os.execl(python, python, * sys.argv) |
| #!/usr/bin/python | |
| import gtk | |
| class StatusIcon: | |
| def __init__(self): | |
| self.statusicon = gtk.StatusIcon() |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # prerequisites : | |
| # sudo apt-get install nmap | |
| # | |
| # nmap.py | |
| # Network Radar | |
| # | |
| # | |
| # This program is free software; you can redistribute it and/or modify |
| def outsideFunc(Func): | |
| def one(*args, **kwargs): | |
| print Func(*args, **kwargs) | |
| def two(*args, **kwargs): | |
| print Func(*args, **kwargs) | |
| def nothing(*args, **kwargs): | |
| print Func(*args, **kwargs) |
| class SetterNGetter(): | |
| def __init__(self, *args, **kwargs): | |
| self.my_age = kwargs['age'] | |
| self.my_name = kwargs['name'] | |
| @property | |
| def my_age(self): | |
| return self.my_age |
| class LogWrappedFunction(object): | |
| def __init__(self, function): | |
| self.function = function | |
| def logAndCall(self, *arguments, **namedArguments): | |
| print "Calling %s with arguments %s and named arguments %s" %\ | |
| (self.function.func_name, arguments, namedArguments) | |
| self.function.__call__(*arguments, **namedArguments) | |
| def logwrap(function): |