Skip to content

Instantly share code, notes, and snippets.

View olleolleolle's full-sized avatar
🙌
In sunny Malmö in Sweden 🌞

Olle Jonsson olleolleolle

🙌
In sunny Malmö in Sweden 🌞
View GitHub Profile
@olleolleolle
olleolleolle / ide-in-swedish.diff
Created May 26, 2010 13:14
Se-IDE in Swedish
Index: ide/src/extension/locale/sv-SE/options.dtd
===================================================================
--- ide/src/extension/locale/sv-SE/options.dtd (revision 0)
+++ ide/src/extension/locale/sv-SE/options.dtd (revision 0)
@@ -0,0 +1,26 @@
+<!ENTITY options.encoding.description "Textkodning i testfiler">
+<!ENTITY options.timeout.description "Standard timeoutvärde i inspelade kommandon">
+<!ENTITY options.userExtensionsPaths.description "Selenium Core-tillägg (user-extensions.js)">
+<!ENTITY options.ideExtensionsPaths.description "Selenium IDE-tillägg">
+<!ENTITY options.extensions.tip "Tips om tillägg: Stäng och öppna Selenium IDE-fönstret för att få ändringarna att slå igenom. Du kan ange flera filer, avdelade med kommatecken.">
@olleolleolle
olleolleolle / ext-jquery-adapter-debug.js
Created May 31, 2010 12:53
Here I tried to add support for abort() - notice anything very borked?
/*!
* Ext JS Library 3.1.0
* Copyright(c) 2006-2009 Ext JS, LLC
* [email protected]
* http://www.extjs.com/license
* Olle Jonsson added some jQuery abort functionality
*/
// for old browsers
window.undefined = window.undefined;
@olleolleolle
olleolleolle / pre-commit.bat
Created June 11, 2010 07:40 — forked from jesperronn/pre-commit.bat
[useful] Subversion pre-commit hook for Windows machine
REM Subversion pre-commit hook for Windows machine
REM put this in your SVN repository folder /hooks/pre-commit.bat
REM we use it with svn version
REM http://stackoverflow.com/questions/869248/windows-pre-commit-hook-for-comment-length-subversion
@echo off
:: Stops commits that have empty log messages.
@echo off
setlocal
@olleolleolle
olleolleolle / start_ie_as_7.py
Created June 14, 2010 15:28
Regkey to make IE start as IE7.
#!/bin/env python
import _winreg as winreg
"""
Regkey to make IE start as IE7.
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
HKEY_LOCAL_MACHINE (or HKEY_CURRENT_USER)
SOFTWARE
Microsoft
@olleolleolle
olleolleolle / stitcher.rb
Created July 28, 2010 08:05
Using UDP to send images as bytes to a custom-built hardware.
#!/usr/bin/env ruby -wKU
#
# stitcher: Sends UDP packets of 1024 bytes to the custom-built display.
#
# Sync packet: "synk" is sent before an image.
# 64x48 is the screen size of the custom-built display.
# The @fps setting configures frames per second.
#
# Here's a random invocation of ffmpeg:
@olleolleolle
olleolleolle / jsTestDriver-assertions-for-the-wiki.txt
Created August 5, 2010 07:56
jsTestDriver assertions wiki text. Conveniently saved as a Gist.
== `fail([msg])` ==
Throws a JavaScript Error with given message string.
== `assert([msg], actual)` ==
== `assertTrue([msg], actual)` ==
Fails if the result isn't truthy. To use a message, add it as the first parameter.
@olleolleolle
olleolleolle / DB_Sqlite_Tools_preg_match.patch
Created August 17, 2010 08:07
DB_Sqlite_Tools_preg_match.patch
Index: DB/Sqlite/Tools.php
===================================================================
--- DB/Sqlite/Tools.php (revision 302149)
+++ DB/Sqlite/Tools.php (working copy)
@@ -371,7 +371,7 @@
$this->sqliteQuery('PRAGMA default_cache_size');
}
} else {
- if (!eregi('[[:digit:]]', $pages)) {
+ if (!preg_match("/\d/", $pages)) {
@olleolleolle
olleolleolle / DB_ldap2_using_preg_split.patch
Created August 17, 2010 08:08
DB_ldap2_using_preg_split.patch
Index: ldap2.php
===================================================================
--- ldap2.php (revision 302149)
+++ ldap2.php (working copy)
@@ -936,7 +936,7 @@
!$this->isManip(isset($query['action']) ? $query['action'] : $this->param['action'])
) {
$filter = $query[0];
- $tokens = split("[\&\?\!]", $filter);
+ $tokens = preg_split("/[\&\?\!]/", $filter);
@olleolleolle
olleolleolle / DB_ldap_use_preg_match.patch
Created August 17, 2010 08:08
DB_ldap_use_preg_match.patch
Index: ldap.php
===================================================================
--- ldap.php (revision 302149)
+++ ldap.php (working copy)
@@ -952,7 +952,7 @@
function createSequence($seq_name)
{
// Extract $seq_id from DN
- ereg("^([^,]*),", $seq_name, $regs);
+ preg_match("/^([^,]*),/", $seq_name, $regs);
@olleolleolle
olleolleolle / DB_using_preg_match.patch
Created August 17, 2010 08:08
DB_using_preg_match.patch
Index: DB/ifx.php
===================================================================
--- DB/ifx.php (revision 302149)
+++ DB/ifx.php (working copy)
@@ -536,7 +536,7 @@
*/
function errorCode($nativecode)
{
- if (ereg('SQLCODE=(.*)]', $nativecode, $match)) {
+ if (preg_match('/SQLCODE=(.*)]/', $nativecode, $match)) {