Skip to content

Instantly share code, notes, and snippets.

@wimleers
wimleers / edit-createjs.patch
Created August 27, 2012 15:27
Edit -> use Create.js
diff --git a/edit.module b/edit.module
index d126f40..bc5de1a 100644
--- a/edit.module
+++ b/edit.module
@@ -112,11 +112,32 @@ function edit_library() {
$wysiwyg_module = variable_get(EDIT_WYSIWYG_VARIABLE, EDIT_WYSIWYG_DEFAULT);
$path = drupal_get_path('module', 'edit');
+
+ $libraries['edit.createjs'] = array(
TABLENODATA="%search% %cache% xmlsitemap% droptor_memory flood history sessions watchdog"
<?xml version="1.0" encoding="utf-8"?>
<config>
<!-- Sources -->
<sources ignoredDirs="CVS:.svn">
<source name="desktop" scanPath="/Users/wimleers/Desktop/watch" />
</sources>
<!-- Servers -->
<servers>
<server name="origin pull cdn" transporter="symlink_or_copy">
@wimleers
wimleers / .htaccess
Created November 15, 2011 06:37
.htaccess file to only allow downloads from Amazon CloudFront.
Options +FollowSymLinks -MultiViews
RewriteEngine On
SetEnvIf User-Agent ^Amazon Cloudfront$ cdn
Order Deny,Allow
Deny from all
Allow from env=cdn
"""pathscanner.py Scans paths and stores them in a sqlite3 database
You can use PathScanner to detect changes in a directory structure. For
efficiency, only creations, deletions and modifications are detected, not
moves.
Modified files are detected by looking at the mtime.
Instructions:
- Use initial_scan() to build the initial database.
@wimleers
wimleers / php-codesize.py
Created August 10, 2011 21:59
Calculates the size of the PHP codebase of all sites.
#!/usr/bin/env python
# Calculates the size of the PHP codebase of all sites.
import os
import optparse
import subprocess
def calculate(http_root_dir):
sites = list_sites(http_root_dir)
diff --git code/arbitrator.py code/arbitrator.py
index a56cd43..071c913 100644
--- code/arbitrator.py
+++ code/arbitrator.py
@@ -247,6 +247,7 @@
# Create connection to synced files DB.
self.dbcon = sqlite3.connect(SYNCED_FILES_DB)
+ self.dbcon.text_factory = str
self.dbcur = self.dbcon.cursor()
# Delete all log files older than 100 days that are not Episodes log files.
find /data/logs/apache -not \( -name "*episodes*" \) -mtime +100 -exec /bin/rm -f {} \;
@wimleers
wimleers / output.txt
Created May 23, 2011 19:17
Master thesis working! This is some sample output.
mining association rules complete, # association rules: 166
(
{episode:css(0), ua:WinXP:Firefox(60)} => {duration:slow(16)} (conf=0.280632)
{episode:css(0), ua:WinXP:Firefox(60), ua:WinXP:Firefox:3(61)} => {duration:slow(16)} (conf=0.290043)
{episode:css(0), ua:WinXP:Firefox:3(61)} => {duration:slow(16)} (conf=0.290043)
{episode:pageready(39)} => {duration:slow(16)} (conf=0.398305)
{location:AS(3), episode:css(0)} => {duration:slow(16)} (conf=0.216981)
{location:AS(3), episode:pageready(39)} => {duration:slow(16)} (conf=0.639344)
{location:AS(3), episode:totaltime(40)} => {duration:slow(16)} (conf=0.639344)
{location:AS(3), ua:WinXP:IE(8), episode:frontend(19)} => {duration:slow(16)} (conf=0.468927)
@wimleers
wimleers / weird.cpp
Created May 23, 2011 18:29
Note that the array index that is used goes beyond the array's capacity. And thus it modifies the next variable in memory…
#include <stdio.h>
#define uint unsigned int
#define TTW_NUM_GRANULARITIES 5
class Weird {
public:
Weird() {
this->lastUpdate = 0;
for (int g = 0; g < TTW_NUM_GRANULARITIES; g++)