Skip to content

Instantly share code, notes, and snippets.

@ns-1m
ns-1m / install-pygtk.sh
Created November 16, 2012 05:56 — forked from ches/install-pygtk.sh
Install PyGTK via Homebrew and virtualenv
# This LOOKS pretty straightforward, but it took awhile to sort out issues with
# py2cairo and pygobject, so I hope I've saved you some time :-)
#
# This assumes you already subscribe to a nice clean virtualenvwrapper workflow
# -- see https://gist.github.com/771394 if you need advice on getting there.
# There are some optional dependencies omitted, so if you're going to be doing
# heavy development with these libs, you may want to look into them.
#
# We go to some configure option pains to avoid polluting the system-level
# Python, and `brew link`ing Cairo which is keg-only by default.
@ns-1m
ns-1m / gist:4049127
Created November 9, 2012 23:58 — forked from NathanW2/gist:4029400
Print composer
from qgis.core import *
from qgis.gui import *
from PyQt4.QtCore import *
from PyQt4.QtGui import QApplication
from PyQt4.QtXml import *
import sys
import xml.etree.ElementTree as ET
app = QgsApplication([], True)
@ns-1m
ns-1m / sqlite2pg.sh
Created October 27, 2012 04:47 — forked from eclubb/sqlite2pg.sh
Script to import SQLite3 database into PostgreSQL
#!/bin/sh
# This script will migrate schema and data from a SQLite3 database to PostgreSQL.
# Schema translation based on http://stackoverflow.com/a/4581921/1303625.
# Some column types are not handled (e.g blobs).
SQLITE_DB_PATH=$1
PG_DB_NAME=$2
PG_USER_NAME=$3
@ns-1m
ns-1m / qgis-nightly-build.sh
Created August 2, 2012 01:37 — forked from dakcarto/qgis-nightly-build.sh
Bash script for local nightly builds of QGIS master branch on Mac OS X Snow Leopard and Lion
#!/bin/bash
# -*- coding: utf-8 -*-
#
# Create QGIS for Mac OS X nightly build from github.com 'master' branch.
# Keep a number of dmg archives of previous builds as backups.
#
# Tested under Lion 10.7.4 and Snow Leopard 10.6.8, **run via sudo**
# Requires same kyngchaos.com framework setup and build environment as per
@ns-1m
ns-1m / geojson.js
Created July 8, 2012 02:40 — forked from mourner/geojson.js
Leaflet GeoJSON API proposal
var geojson = L.geoJson(data, {
// style for all vector layers (color, opacity, etc.) (optional)
getStyle: function (feature) {
return feature.properties && feature.properties.style;
},
// function for creating layers for GeoJSON point features (optional)
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
@ns-1m
ns-1m / README.txt
Created June 29, 2012 04:47 — forked from davidfischer/README.txt
How Social is Your Code?
When one says "social coding" I ask "how social"? One measure of social-ness is the number of distinct collaborators.
The data is from the github.timeline dataset. The visualization uses D3 and is adapted from the Sunburst example.
Click http://bl.ocks.org/2866246 to view it in all its glory.
@ns-1m
ns-1m / dsShows.cshtml
Created June 25, 2012 10:48 — forked from theClarkSell/dsShows.cshtml
Consuming an OData Service from jQuery
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="author" content="Clark Sell" />
<title>Consuming an OData Service from jQuery</title>
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.6.2.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script> <!-- http://api.jquery.com/category/plugins/templates/ -->
@ns-1m
ns-1m / ODataTable.html
Created June 25, 2012 05:59 — forked from qmacro/ODataTable.html
SAPUI5 says "Hello OData" to NetWeaver Gateway
// I am trying to modify this gist inorder to run into iPhone/iPad using jquery with User login (User, Password and source)
// Details using SAP gateway demo. I think we can modify this source
// http://gateway.server:port/sap/opu/sdata/IWFND/RMTSAMPLEFLIGHT/?$format=xml
// This is the SAP demo gateway portal
http://www.sdn.sap.com/irj/sdn/index?rid=/webcontent/uuid/1051f6d9-e87a-2e10-d188-e2786c7878b1
User: GW@ESW
Password: "ESW4GW"
@ns-1m
ns-1m / leaflet-button-control.js
Created June 15, 2012 09:07 — forked from ejh/leaflet-button-control.js
Leaflet control button example
// How to use it?
// OnAdd() is called when you use:
// var footButton = new L.Control.Button(footButtonOpts).addTo(map);
// It is passed the map object to which your control is being added.
// The third parameter passed to L.DomEvent.addListener is the context ('this' keyword) which
// you wish to have in the callback (second parameter).
// I still don't know how to use it.
@ns-1m
ns-1m / index.html
Created June 9, 2012 02:43 — forked from elsewhat/index.html
PhoneGap and SAPUI5 index file
<html>
<head>
<title></title>
<script type="text/javascript" charset="utf-8" src="phonegap/cordova-1.6.0.js"></script>
<script id="sap-ui-bootstrap"
type="text/javascript"
src="sapui5/resources/sap-ui-core.js"
data-sap-ui-theme="sap_platinum"