This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from flask.ext.sqlalchemy import SQLAlchemy | |
from app.views.index import IndexView | |
app = Flask(__name__) | |
app.config.from_object('config') | |
db = SQLAlchemy(app) | |
IndexView.register(app) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Here is where all starts he actually counted the characters from the SOAP response | |
projectname = Mid(xmlhttp.responseText, 339, 30) | |
'And here the explaned stupidity | |
'Aufgrund fehlender Funktionalität händische Überprüfung | |
'auf schließendes Tag </projektname> und dessen Teil-Mengen | |
'mit anschließender Entfernung aus der Variablen | |
If InStr(projektname, "</projectname>") Then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test(): | |
print "Call from global" | |
globals()["test"]() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
# -*- coding: utf-8 -*- | |
# | |
# app.py | |
# | |
# Copyright 2012 Vladimir Kolev <vladi@elementos> | |
# | |
# This is a semple application using the Granite widgets | |
# from the ElementaryOS project | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import cStringIO | |
import json | |
import sys | |
from pygments import highlight | |
from pygments.formatters import Terminal256Formatter | |
from pygments.lexers.web import JavascriptLexer | |
from pygments import styles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from distutils.core import setup | |
import py2exe | |
opts = { | |
'py2exe': { | |
'includes': 'pango,atk,gobject', | |
'dll_excludes': [ | |
'iconv.dll', 'intl.dll', 'libatk-1.0-0.dll', | |
'libgdk_pixbuf-2.0-0.dll', 'libgdk-win32-2.0-0.dll', | |
'libglib-2.0-0.dll', 'libgmodule-2.0-0.dll', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Tab indention for Python | |
(setq-default indent-tabs-mode nil) | |
(setq default-tab-width 4) | |
;; Pymacs configuration | |
(add-to-list 'load-path "~/.emacs.d/vendor") | |
(require 'pymacs) | |
(pymacs-load "ropemacs" "rope-") | |
(setq ropemacs-enable-autoimport t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First method to run a function from string | |
# here we use the dir method to get the available functions in django | |
# and we know that the 7-th result in the array is the function get_version() since | |
# I have tested it, but it can be any other | |
import django | |
test = dir(django) | |
print "\nFirst example is running function from django called %s" % test[7] | |
print "result: %s" % django.__getattribute__(test[7])() | |
# Second method to run a function from string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# formatter.py | |
# | |
# Copyright 2010 Vladimir Kolev <admin@vladimirkolev.com> | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub on_join { | |
# get our connection object and the event object, which is passed | |
# with this event automatically | |
my ($conn, $event) = @_; | |
# this is the nick that just joined | |
my $nick = $event->{nick}; | |
# say hello to the nick in public | |
$conn->privmsg($conn->{channel}, "Hello, $nick!"); |