Skip to content

Instantly share code, notes, and snippets.

@enumag
enumag / Timer.php
Created February 11, 2012 20:00
PHP Timer
<?php
class Timer {
public static $time = array();
public static $last;
public static function start($name = NULL) {
static $i = 0;
@enumag
enumag / explode.cpp
Created January 2, 2012 11:32
C++ explode
std::vector<std::string> explode(std::string str, char delim = ' ') {
std::vector<std::string> result;
std::stringstream stream(str);
std::string buffer = "";
while (std::getline(stream, buffer, delim)) {
result.push_back(buffer);
}
return result;
}