Skip to content

Instantly share code, notes, and snippets.

View ameliaikeda's full-sized avatar
💜
probably drinking tea

Amelia Wylie ameliaikeda

💜
probably drinking tea
View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf8 -*-
import urllib
from time import sleep
meta = open("/Users/hiroto/metadata", "r+")
prev_song = False
while True:
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
<xsl:output omit-xml-declaration="yes" method="xml" encoding="UTF-8" />
<xsl:template match = "/icestats" >
<pre>
<xsl:for-each select="source">
<xsl:value-of select="artist" /> - <xsl:value-of select="title" />
</xsl:for-each>
</pre>
</xsl:template>
</xsl:stylesheet>
@ameliaikeda
ameliaikeda / dumper.py
Last active January 2, 2016 13:39
R/a/dio database dumper (for songs).
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from mutagen.easyid3 import EasyID3
from mutagen.id3 import ID3
import MySQLdb
import MySQLdb.cursors
import shutil
import os
09:31:26 (laravel)~! ~/Dropbox/osu-laravel
(hiroto~dev)$ php --version
PHP 5.5.7-1~dotdeb.1 (cli) (built: Dec 14 2013 21:40:10)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
@ameliaikeda
ameliaikeda / AjaxTrait.php
Created January 15, 2014 19:25
Laravel AJAX trait addition for HTML5 History navigation
<?php
trait AjaxTrait {
/**
* Setup the layout used by the controller.
*
* @return void
*/
protected function setupLayout() {
# osu!web
server {
listen 80;
server_name beta.osu.hiroto.eu chi.ppy.sh;
error_log /home/hiroto/Dropbox/logs/osu/error-laravel.log;
root /home/hiroto/Dropbox/osu-laravel/public;
index index.php index.html;
server {
listen 80;
server_name localhost marcin.dkun.us; # aliases
root /path/to/laravel/public;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
mysql> select meta from postpending where accepted = 0 and reason like("%mash%");
+-------------------------------------------------------------------------------------------------------+
| meta |
+-------------------------------------------------------------------------------------------------------+
| PSY vs. Sengoku Nadeko - Gangnam Circulation |
| DJ Rgie Gatmaitan - Don't Say "Ladies" (Put a Tequ |
| DJ Rgie Gatmaitan - Don't Say "Ladies" (Put a Tequ |
| Kira Kira (Tea) Parties and Bullshit.mp3 |
| Hidamari Sketch ft. Wiz Khalifa - Black and Yellow Sketch |
| cat'syama - zutto with you friends (Skrillex vs ?????
$(window).on("statechange", function(event) {
var state = History.getState();
var root = History.getRootUrl();
var uri = state.url.replace(root, "/");
var $next = $("[data-uri='" + uri + "']");
if ($next.length) {
// we've been to this page before.
<?php
use GetId3\GetId3Core as ID3;
use Symfony\Component\HttpFoundation\File\UploadedFile;
trait Analysis {
// min, max
protected $bitrate = 128.0; // kbps