Skip to content

Instantly share code, notes, and snippets.

dgw dgw

Block or report user

Report or block dgw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dgw
dgw / lastfm.php
Last active Aug 29, 2015 — forked from dewey/lastfm.php
Forked from dewey and changed to display "last listened to" if the latest track in the feed is not currently playing.
View lastfm.php
#!/usr/bin/php
<?php
$doc = new DOMDocument();
$doc->load("http://ws.audioscrobbler.com/2.0/user/voyagerfan5761/recenttracks.xml?limit=1");
$arrFeeds = array();
foreach ($doc->getElementsByTagName('track') as $node) {
$itemRSS = array (
'artist' => $node->getElementsByTagName('artist')->item(0)->nodeValue,
'name' => $node->getElementsByTagName('name')->item(0)->nodeValue,
'nowplaying' => ($node->attributes->getNamedItem('nowplaying')) ? true : false
View keybase.md

Keybase proof

I hereby claim:

  • I am dgw on github.
  • I am dgw (https://keybase.io/dgw) on keybase.
  • I have a public key whose fingerprint is FD79 4B46 9B89 955F 2083 4558 7C9E E7B7 D379 F9CC

To claim this, I am signing this object:

@dgw
dgw / log.cpp
Created Aug 20, 2013
log.cpp changes
View log.cpp
CFile LogFile(sPath);
CString sLogDir = LogFile.GetDir();
struct stat ModDirInfo;
CFile::GetInfo(GetSavePath(), ModDirInfo);
if (!CFile::Exists(sLogDir)) CDir::MakeDir(sLogDir, ModDirInfo.st_mode);
if (LogFile.Open(O_WRONLY | O_APPEND | O_CREAT))
@dgw
dgw / wsa_endnotes.php
Created Jun 9, 2012
WSA Endnotes - Parse shortcodes in notes change
View wsa_endnotes.php
function wsa_the_content_filter( $content ) {
if ( is_single() ) {
$notes = wsa_endnotes( true );
if ( !empty($notes) ) {
$content .= '<div class="wsa-footnotes"><ol>';
foreach($notes as $i => $note) {
$num = $i + 1;
$content .= sprintf( '<li><a name="wsa-endnote-%d"></a>%s &nbsp;<a href="#wsa-inline-%d" class="wsa-up">&#9650;</a></li>',
$num, do_shortcode($note), $num
);
@dgw
dgw / Q1P3.java
Created Oct 18, 2011
Problem 3, Quiz 1, COSI 11A (Fall 2011), Brandeis University
View Q1P3.java
/* ******************************** *\
* Package Name: Q1P3 *
* Description: The code from Quiz *
* 1, Problem 3 in the Fall 2011 *
* COSI 11A course at Brandeis. *
* Purpose: Demonstrating how the *
* given expressions really eval. *
\* ******************************** */
public class Q1P3 {
@dgw
dgw / google-authenticator.php
Created Oct 13, 2011
Google Authenticator for WordPress - patch(es)
View google-authenticator.php
<?php
/*
Plugin Name: Google Authenticator
Plugin URI: http://henrik.schack.dk/google-authenticator-for-wordpress
Description: Two-Factor Authentication for WordPress using the Android/iPhone/Blackberry app as One Time Password generator.
Author: Henrik Schack
Version: 0.37
Author URI: http://henrik.schack.dk/
Compatibility: WordPress 3.2.1
Text Domain: google-authenticator
@dgw
dgw / Xorg.0.log.failed
Created Dec 10, 2010
Four sample sessions from my Xorg.0.log files. To aid debugging hardware issues with my Dell Inspiron 2650 under Ubuntu.
View Xorg.0.log.failed
/* ************************************** *
* This is the first sample session, when *
* the keyboard and touchpad were not *
* detected and didn't work *
* ************************************** */
[ 23.875]
X.Org X Server 1.9.0
Release Date: 2010-08-20
[ 23.875] X Protocol Version 11, Revision 0
View git-bash-portable.bat
@echo off
rem Copyright (C): 2010 Voyagerfan5761
rem http://technobabbl.es/
set USERPROFILE=%~dp0
set HOMEDRIVE=%~d0
set HOMEPATH=%~p0
set HOME=%~dp0
set HISTFILE=%USERPROFILE%.bash_history
rem set BASHRC=%USERPROFILE%.bashrc
You can’t perform that action at this time.