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
test=# create table j (id1 int, id2 int); | |
CREATE TABLE | |
test=*# create unique index idx_j on j(greatest(id1, id2), least(id1, id2)); | |
CREATE INDEX | |
test=*# insert into j values (1,2); | |
INSERT 0 1 | |
test=*# insert into j values (2,1); | |
ERROR: duplicate key violates unique constraint "idx_j" |
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 | |
################################################## | |
# little programming exercise using twisted irc | |
# ibot is a infobot which whole purpose is to | |
# autorespond to a defined set of keywords with | |
# a stored phrase | |
# $Id: bot.py,v 1.4 2003/12/14 13:38:29 pfote Exp $ | |
################################################## |
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 selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import Select | |
from selenium.common.exceptions import NoSuchElementException | |
import unittest, time, re | |
class FlwebBookingWebdriver(unittest.TestCase): | |
def setUp(self): | |
self.driver = webdriver.Firefox() | |
self.driver.implicitly_wait(30) |
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
[2013-02-28 15:53:39] codeigniter.DEBUG: Monolog replacement logger initialized | |
[2013-02-28 15:53:39] codeigniter.DEBUG: Config Class Initialized | |
[2013-02-28 15:53:39] codeigniter.DEBUG: Hooks Class Initialized | |
[2013-02-28 15:53:39] codeigniter.DEBUG: Utf8 Class Initialized | |
[2013-02-28 15:53:39] codeigniter.DEBUG: UTF-8 Support Enabled | |
[2013-02-28 15:53:39] codeigniter.DEBUG: URI Class Initialized | |
[2013-02-28 15:53:39] codeigniter.DEBUG: Router Class Initialized | |
[2013-02-28 15:53:39] codeigniter.DEBUG: No URI present. Default controller set. | |
[2013-02-28 15:53:39] codeigniter.DEBUG: Output Class Initialized | |
[2013-02-28 15:53:39] codeigniter.DEBUG: Security Class Initialized |
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 | |
# -*- coding: utf-8 -*- | |
from Crypto.Cipher import AES | |
import base64 | |
import random | |
import hashlib | |
import os | |
class AesCrypt256: |
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
#!/bin/sh | |
# script zum lifestellen | |
cd /var/www/ypsilon_git | |
revision=$1 | |
host=`hostname` | |
if [ x$revision == 'x' ]; then | |
revision='master' | |
fi |
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
<IfModule mod_php5.c> | |
<FilesMatch "\.ph(p3?|tml)$"> | |
SetHandler application/x-httpd-php | |
</FilesMatch> | |
<FilesMatch "\.phps$"> | |
SetHandler application/x-httpd-php-source | |
</FilesMatch> | |
# To re-enable php in user directories comment the following lines | |
# (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it | |
# prevents .htaccess files from disabling it. |
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
function is_write_type($sql) | |
{ | |
if (( ! preg_match('/^\s*"?(SET|INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|TRUNCATE|LOAD DATA|COPY|ALTER|GRANT|REVOKE|LOCK|UNLOCK)\s+/i', $sql)) | |
AND | |
( ! preg_match('/^\s*INSERT.*RETURNING\s+[\w\*,]+$/i', $sql)) | |
) | |
{ | |
return FALSE; | |
} | |
return TRUE; |
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
import psycopg2 | |
import psycopg2.extensions | |
from select import select | |
from twisted.internet import threads | |
class AsyncNotify(): | |
""" | |
based on http://divillo.com/, adapted to newer psycopg version | |
Class to trigger a function via PostgreSQL NOTIFY messages. |
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
<?php | |
$list = array( | |
array('page_id' => '3', | |
'url' => '/johtamisjarjestelma/yritys', | |
'title' => 'Yritys'), | |
array( | |
'page_id' => '4', | |
'url' => '/johtamisjarjestelma/yritys/historia', | |
'title' => 'Historia'), |
OlderNewer