Skip to content

Instantly share code, notes, and snippets.

Avatar

David Marner nanashiRei

View GitHub Profile
View godfucked.sql
select
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`
from
View splitmysqldump.pl
#!/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
<?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
<?php
/**
* singleton pattern class
*/
class Singleton {
public static function getInstance() {
static $instance;
if (static::$instance == null) {
static::$instance == new self();
}
@nanashiRei
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;