Skip to content

Instantly share code, notes, and snippets.

use Test::More;
use Module;
is($Module::data, undef);
$Module::data = 10;
done_testing();
@maio
maio / 1. install PHPUnit
Created June 2, 2011 16:41
First Test in PHPUnit
# Run these commands to install PHPUnit
# More info @ http://www.phpunit.de/manual/current/en/installation.html
pear channel-discover pear.phpunit.de
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com
pear install phpunit/PHPUnit
# OSX - you may need to upgrade pear before installing PHPUnit
<?php
final class AddController {
public function __construct() {
require 'model/WriteModel.php';
}
public function newPost($name,$text) {
$addModel = new WriteModel($name, $text);
return $addModel;
@maio
maio / .vimrc
Created November 7, 2010 19:42
Vim + Xcode
set errorformat=%f:%l:\ error:\ %m,%f:%l:\ warning:\ %m
set autowrite
au! BufWritePost *.m make! test
// outlets
IBOutlet UILabel *label;
// actions
- (IBAction)onChange:(id)sender;
// storage
[[NSUserDefaults standardUserDefaults] storeFloat: 123 forKey: @"key"];
float value = [[NSUserDefaults standardUserDefaults] floatForKey: @"key"];
@maio
maio / ftest.py
Created September 3, 2009 12:34 — forked from dizzi/gist:180271
import ftplib
import sys
import os
ftpServer = 'xxx'
ftpUser = 'xx'
ftpPass = 'xx'
#ftpPath = 'FileFlowStatus/'
ftpPath = '/'
def get_last_lines(fp, num, step=10):
pos = step
lines = []
quit = False
while len(lines) < num + 1 and not quit:
fp.seek(-pos, 2)
if int(fp.tell()) == 0:
quit = True
lines = fp.readlines()
@maio
maio / gist:171891
Created August 21, 2009 11:42 — forked from dizzi/gist:170633
blogout = new Button("Registrovat");
blogout.addClickHandler(new ClickHandler(){
public void onClick(ClickEvent sender) {
RequestBuilder request = new RequestBuilder(RequestBuilder.POST, GWT.getModuleBaseURL()
+ "userhandling/createUser");
request.setRequestData("username=" + user.getText() + "&password=" + pass.getText() + "&im=" + im.getText()
+ "&email=" + email.getText());
request.setHeader("Content-Type", "application/x-www-form-urlencoded");
request.setCallback(new RequestCallback() {
public void onError(Request request, Throwable exception) {
=item TEST
dsadsasda's dsadsaoi doasuioapo
=cut
sub test {
print qq/pff's lalerweq/;
}
Device Boot Start End Blocks Id System
/dev/sda1 * 23995 24322 2620416 c W95 FAT32 (LBA)
/dev/sda2 15 1320 10485760 7 HPFS/NTFS
/dev/sda3 * 1321 14068 102398310 7 HPFS/NTFS
/dev/sda4 14069 24322 82358472 f W95 Ext'd (LBA)
/dev/sda5 23995 24322 2620416 dd Unknown
/dev/sda6 14069 15343 10241374+ 83 Linux
/dev/sda7 15344 23740 67448871 83 Linux
/dev/sda8 23741 23994 2040223+ 82 Linux swap / Solaris