Skip to content

Instantly share code, notes, and snippets.

View pfdevmuller's full-sized avatar

Pieter Müller pfdevmuller

  • Amazon.com
  • Cape Town
View GitHub Profile
@pfdevmuller
pfdevmuller / pom.xml
Created March 12, 2015 20:25
Corrected version of minimal Mindstorms EV3 Lejos pom from https://lejosev3.wordpress.com/2013/11/07/run-and-debug-java-code-with-eclipse/
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemalocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>MavenRobot</groupId>
<artifactId>MavenRobot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>MavenRobot</name>
<description>This is an example maven project to run Java code one the EV3 brick</description>
<properties>
@pfdevmuller
pfdevmuller / gist:5300352
Created April 3, 2013 11:18
Patch to svn2git that makes it work in Windows for repositories with spaces in the name.
From 6b679b2d1c9918fc817ddcf6e5dbd2bc4d28330a Mon Sep 17 00:00:00 2001
From: Pieter Muller <pfdevmuller@gmail.com>
Date: Wed, 3 Apr 2013 12:54:54 +0200
Subject: [PATCH] Hacked to work with repo names with spaces on Win
I wrapped the arguments for the generated git commands in quotations,
and removed the code replacing spaces with escaped spaces.
I don't know if this will work on Linux, I only tested it on Windows.
---
lib/svn2git/migration.rb | 14 +++++++-------
@pfdevmuller
pfdevmuller / RunSQLiteScript.py
Created March 5, 2013 09:16
Very simple Python script that runs SQL scripts against a given SQLite database.
# <author>Pieter Muller</author>
# <date>2013-03-05</date>
# <note>Targets Python 2.7</note>
import sqlite3 as sqlite
import sys
if __name__ == "__main__":
if (len(sys.argv) != 3):
print "\n\tRequires two arguments:"
@pfdevmuller
pfdevmuller / gist:5049676
Created February 27, 2013 17:16
Error dump of `pip install numpy`, using pip v1.3rc1
------------------------------------------------------------
C:\Python27\Scripts\pip-script.py run on 02/27/13 19:13:01
Downloading/unpacking numpy
Getting page https://pypi.python.org/simple/numpy/
URLs to search for versions for numpy:
* https://pypi.python.org/simple/numpy/
Getting page http://numpy.scipy.org
Could not fetch URL http://numpy.scipy.org (from https://pypi.python.org/simple/numpy/): HTTP Error 403: Forbidden
Will skip URL http://numpy.scipy.org when looking for download links for numpy
@pfdevmuller
pfdevmuller / gist:5048912
Created February 27, 2013 15:50
Error dump of `pip install numpy`
------------------------------------------------------------
C:\Python27\Scripts\pip-script.py run on 02/27/13 16:56:48
Downloading/unpacking numpy
Running setup.py egg_info for package numpy
non-existing path in 'numpy\\distutils': 'site.cfg'
F2PY Version 2
@pfdevmuller
pfdevmuller / RunDatabaseScripts.py
Last active October 12, 2015 20:48
Python script that finds and runs other scripts, passing them each an open Database connection.
import glob
import sys
import os
import sqlite3 as sqlite
def LoadScripts(scriptFolder):
''' Returns a list of module references '''
# Find Script Files:
scriptFiles = glob.glob(os.path.join(scriptFolder, "Script*.py"))
print "Found %d Script Files" % (len(scriptFiles))
@pfdevmuller
pfdevmuller / DatabaseSizeSummary.py
Last active January 2, 2020 18:53
Python script to output the number of tables, columns and rows in a SQLite database
# <author>Pieter Muller</author>
# <date>2012-11-14</date>
import sys
import sqlite3 as sqlite
tablesToIgnore = ["sqlite_sequence"]
outputFilename = None