First, install Composer if you don't yet have it:
php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"
Create a composer.json file with the following content:
{
| from os.path import join, splitext, basename | |
| import os | |
| import sys | |
| import hashlib | |
| def file_get_contents(path): | |
| with open(path, 'rb') as file: | |
| return file.read() | |
| for root, dirs, files in os.walk('.'): |
| <?php | |
| /** Number of spaces to leave between columns. */ | |
| define('TABLE_DUMP_COLUMN_PADDING', 3); | |
| /** Maximum number of chars in a column. Longer values will be trucnated. */ | |
| define('TABLE_DUMP_COLUMN_MAX_LENGTH', 50); | |
| /** | |
| * Takes an array of arrays, such as table data from a database and |
| # | |
| # Cross-compiling subsurface for windows, starting with a clean install | |
| # of Fedora 17. | |
| # | |
| # Before starting create a user and add him to /etc/sudoers. | |
| # | |
| # Basic tools | |
| sudo yum install vim git tar |
| <?php | |
| include('../src/main/php/Logger.php'); | |
| Logger::configure(array( | |
| 'appenders' => array( | |
| 'default' => array( | |
| 'class' => 'LoggerAppenderRollingFile', | |
| 'layout' => array( | |
| 'class' => 'LoggerLayoutPattern', |
For a person who prefers Flask so much, @gperetin sure does talk a lot about Django.
import urllib2
import re
url = "https://api.twitter.com/1/statuses/user_timeline.json?screen_name=gperetin&count=200"
data = urllib2.urlopen(url).read()
print len(re.findall('django', data, re.I))| <?php | |
| require 'vendor/autoload.php'; | |
| Logger::configure(array( | |
| 'appenders' => array( | |
| 'default' => array( | |
| 'class' => 'LoggerAppenderFile', | |
| 'layout' => array( | |
| 'class' => 'LoggerLayoutSimple', |
| * table columns should be only lowercase, mixed case can be problematic for PDO |
Create the following stored procedure:
CREATE DBA PROCEDURE foo
(
foo01 NVARCHAR(255),
foo02 NCHAR(50),
foo03 NCHAR(100),
foo04 NCHAR(12),
foo05 NCHAR(8),