Skip to content

Instantly share code, notes, and snippets.


David Marner nanashiRei

View GitHub Profile
View godfucked.sql
count(0) AS `downloads`,
`d`.`timestamp` AS `timestamp`,
'Pack' AS `dltype`,
`p`.`size` AS `size`,
concat(`t`.`theme`,' #',`p`.`packnum`) AS `name`,
`p`.`beatmaps` AS `files`,
`p`.`downloads` AS `totaldownloads`,
concat_ws(';',`t`.`id`,`t`.`theme`,`p`.`packnum`) AS `linkdata`
#!/usr/bin/perl -w
# splitmysqldump - split mysqldump file into per-database dump files.
use strict;
use warnings;
my $dbfile;
my $dbname = q{};
my $header = q{};
while (<>) {
View FormatHelper.class.php
class FormatHelper {
static public function niceSize($bytes, $digits = 2) {
$format = "%0.{$digits}f %s";
$sizeObj = self::bytesHumnaized($bytes);
return sprintf($format, $sizeObj->value, $sizeObj->extension);
static public function bytesHumanized($bytes, $step = 1024) {
View s.php
* singleton pattern class
class Singleton {
public static function getInstance() {
static $instance;
if (static::$instance == null) {
static::$instance == new self();
nanashiRei / style.css
Created Apr 12, 2013
JSON View (Google Chrome Plugin) - Dark Style
View style.css
body {
white-space: pre;
font-family: monospace;
background: #222;
color: #ccc;
.property {
font-weight: normal;
font-style: italic;