Skip to content

Instantly share code, notes, and snippets.

qDebug() << "before:" << this->lastUpdate;
// Update this granularity's used capacity..
this->capacityUsed[granularity] = 0;
qDebug() << "after: " << this->lastUpdate;
@wimleers
wimleers / mysql-slow-log-analytics.sh
Created April 26, 2011 22:28
Script to automatically analyze slow queries of last hour and last 24 hours, using mk-query-digest.
#!/bin/sh
INPUT=/var/log/mysql/mysql-slow.log
OUTPUT_1H=/data/www/wimleers.com/status/mysql-slow-1h.txt
OUTPUT_24H=/data/www/wimleers.com/status/mysql-slow-24h.txt
# Perform the analytics, overwriting the previous results.
../scripts/mk-query-digest --since 1h $INPUT > $OUTPUT_1H
../scripts/mk-query-digest --since 24h $INPUT > $OUTPUT_24H
@wimleers
wimleers / .bash_profile
Created March 25, 2011 17:13
My bash prompt. Inelegant code, yet elegant result.
# Colorizing. Source: http://systhread.net/texts/200703bashish.php.
DULL=0
BRIGHT=1
FG_BLACK=30
FG_RED=31
FG_GREEN=32
FG_YELLOW=33
FG_BLUE=34
@wimleers
wimleers / dps-s3-rsync.sh
Created January 20, 2011 10:49
Script that syncs a directory recursively to Amazon S3 using s3sync.
#!/bin/bash
export AWS_ACCESS_KEY_ID=yourID
export AWS_SECRET_ACCESS_KEY=yourSecret
export AWS_TARGET_BUCKET=DriverPacks_back-up
export AWS_TARGET_DIR=/
export SOURCE_DIR=/data/www/downlodsorigin.driverpacks.net/
export S3SYNC_DIR=/home/wim/scripts/s3sync
export SSL_CERT_DIR=/etc/ssl/certs
@wimleers
wimleers / video-js.css
Created January 15, 2011 15:16
A very basic port of the VideoJS module for Drupal 7.
Copy from VideoJS.
@wimleers
wimleers / gist:750179
Created December 21, 2010 16:37
Wait for input by the user on stdin — the Qt way (and thus cross-platform).
QTextStream in(stdin);
forever {
QString line = in.readLine();
if (!line.isNull())
break;
}
@wimleers
wimleers / other_files_shadow_builds.pri
Created December 18, 2010 17:25
Automatically copy all files listed in OTHER_FILES to the build directory when using shadow builds.
# Copy all OTHER_FILES to the build directory when using shadow builds.
!equals($${PWD}, $${OUT_PWD}) {
unix:COPY = cp
win32:COPY = copy /y
for(other_file, OTHER_FILES) {
QMAKE_PRE_LINK += $${COPY} $${PWD}/$${other_file} $${OUT_PWD}/$${other_file};
}
}
@wimleers
wimleers / git — branching from an upstream branch.txt
Created December 16, 2010 11:38
git — branching from an upstream branch
--( ~/Work/redbot (master) )-- git remote add upstream https://github.com/mnot/redbot.git
--( ~/Work/redbot (master) )-- git fetch upstream
From https://github.com/mnot/redbot
* [new branch] gh-pages -> upstream/gh-pages
* [new branch] master -> upstream/master
--( ~/Work/redbot (master) )-- git fetch upstream master:har-postData
From https://github.com/mnot/redbot
* [new branch] master -> har-postData
--( ~/Work/redbot (master) )-- git checkout har-postData
Switched to branch 'har-postData'
@wimleers
wimleers / mantis-1.2.3-to-1.2.4.patch
Created December 15, 2010 14:03
See http://www.mantisbt.org/blog/?p=123. Command used: git diff --no-prefix release-1.2.3..release-1.2.4 > mantis-1.2.3-to-1.2.4.patch
diff --git .gitignore .gitignore
index ad522c6..2a0e079 100644
--- .gitignore
+++ .gitignore
@@ -19,6 +19,9 @@ build/
# Untracked plugins
plugins/*
+!plugins/MantisCoreFormatting
+!plugins/MantisGraph
@wimleers
wimleers / gist:722461
Created November 30, 2010 21:39
Drupal CDN module (http://drupal.org/project/cdn) version 2.0 release notes
I was (finally!) creating the final release for one my modules (the CDN module). I had typed quite a bit in the release notes field. So I wanted to verify that those release notes looked ok, by clicking the Preview button. Unfortunately, that's where things went wrong.
It seems Drupal.org created a *completely* messed up project release node: no version number in the node title (just 'cdn'), no version number in the file name (just 'cdn-.tar.gz'), linked to the correct CVS tag (which I can also not select again when creating a new project release), with a (seemingly) valid tarball, but no release notes. See it for yourself at http://drupal.org/node/985576.
Screenshots attached (fortunately, Google Chrome has an excellent backward cache, which included the form in its full glory).
So:
1) could you please delete that messed up project release node or edit it to have version number 2.0 and the following release notes:
<code>
The goal for 2.0 is simple: make the CDN module kick ass. This will be done in three