Skip to content

Instantly share code, notes, and snippets.

@OrangeTux
OrangeTux / gist:4683870
Last active December 12, 2015 00:28 — forked from anonymous/gist:4683842
class Initializer:
""" Initializes this demo
"""
def __init__(self):
""" Create a Messenger and pass this messenger
to a new formed Sensor.
"""
self.messenger = create_messenger()
for gene in genes:
# Length of the gene
gene_length = gene.length
indexes = []
for i in enumerate(gene_length):
indexes[i] = ''
set nocompatible
set number
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
syntax on
filetype plugin indent on
" Bundles
Bundle 'gmarik/vundle'
@OrangeTux
OrangeTux / Flask with CouchDB
Created May 16, 2013 11:10
Forget about the imports and accidental typo's.
### app.py ###
app = Flask(__name__)
app.register_blueprint(keywords.blueprint)
manager = CouchDBManager()
manager.setup(app)
manager.add_document(Keyword)
server = Server()
@OrangeTux
OrangeTux / config
Last active June 19, 2021 13:18
Config for Irssi to connect to various XMPP chat servers. Replace the passwords, usernames an ids by your own. Remember, the irssi-xmpp (http://cybione.org/~irssi-xmpp/) plugin is requried.
# irssi-xmpp plugin required
# http://cybione.org/~irssi-xmpp/
servers = (
{
address = "chat.facebook.com";
chatnet = "facebook";
password = "<password>";
autoconnect = "true";
},
{
@OrangeTux
OrangeTux / gist:5803416
Created June 18, 2013 07:49
Vim problem
<line fill="#848484" x1="93.67" y1="98.35" x2="100.9" y2="98.35"/>
# Should become
# rect.x = line.x2-line.x1;
# rect.y = line.y2-line.y1;
# width = 7.23 // This is a static
# height = 7.23 // This is a static
<rect x="4.68" y="2.55" fill="#848484" width="7.23" height="7.23"
""" computer.py """
from internet import visit_website
class Computer:
def __init__(self):
print('Booting')
def play_game(self, game):
print('You are playing %s.' % game)
""" adapters.py """
class PinAdapter:
def __init__(self, *args):
if(os.uname()[4][:3] != 'arm'):
return MockPin(*args)
else:
from ablib import Pin
return Pin(*args)
class MockPin:
@OrangeTux
OrangeTux / php
Last active December 24, 2015 07:29 — forked from anonymous/funtion
function checkEmpty ($item, $errormessage, &$error){
if (!empty($_POST[$item])){
$name = $_POST[$item];
}
else{
$error[] = $errormessage;
}
}
# Initialize empty array.
<?php
function ref($var)
{
$var[] = 'Item';
}
$es = array();
ref($es);
ref($es);