Skip to content

Instantly share code, notes, and snippets.

!function() {
var doc = document,
htm = doc.documentElement,
lct = null, // last click target
nearest = function(elm, tag) {
while (elm && elm.nodeName != tag) {
elm = elm.parentNode;
}
return elm;
};
@lou
lou / gmap-fullscreen.js
Created January 2, 2012 12:10
Google map Fullscreen with jQuery
$(function() {
var map = new google.maps.Map(document.getElementById("map_canvas"), {});
var newyork = new google.maps.LatLng(40.69847032728747, -73.9514422416687);
var googleMapWidth = $("#map_canvas").css('width');
var googleMapHeight = $("#map_canvas").css('height');
map.setCenter(newyork);
$('#enter-full-screen').click(function(){
@jamesjohnson
jamesjohnson / README.md
Created February 19, 2012 22:07 — forked from dlo/README.md
Ubuntu 11.10, PostGIS 1.5 Setup Script

Installing PostGIS

Ubuntu 11.10

sudo apt-get install postgresql-9.1-postgis
sudo su postgres
bash <(curl -s https://raw.github.com/gist/18660599/create_template.sh)

Ubuntu 11.04

@just-digital
just-digital / gist:1868435
Created February 20, 2012 08:33
A .vimrc file for Drupal. Sets correct tabs configuration and a few other gems. Also includes function from Aron Novak (http://drupal.org/user/61864) sourced at http://vim.wikia.com/wiki/Remove_unwanted_spaces which will remove trailing white space upon
set nocompatible
syntax on
filetype on
filetype plugin on
filetype indent on
set sidescroll=1
set sidescrolloff=3
@kyanny
kyanny / fib.exs
Created March 13, 2012 01:27
Elixir fibonacci #1
defmodule Fib do
def fib(0) do 0 end
def fib(1) do 1 end
def fib(n) do fib(n-1) + fib(n-2) end
end
IO.puts Fib.fib(10)
@kindly
kindly / apache virtual host.
Created May 24, 2012 15:50
Sample apache configuration for running ckan side by side with drupal.
<VirtualHost *:80>
ServerName test.ckan.org
ServerAlias test.ckan.org localhost
#Drupal instance
DocumentRoot /var/www/drupal
DirectoryIndex index.phtml index.html index.php index.htm
# CKAN lives under /data
WSGIScriptAlias /data /dir/to/wsgi.py
@avoine
avoine / gist:2912777
Created June 11, 2012 21:19
Bridge to send rsyslog logs to sentry (http://www.getsentry.com)
#!/usr/bin/env python
#
# Copyright 2012 Patrick Hetu <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@lawlesst
lawlesst / vivoharvester.py
Last active October 11, 2015 08:08
Using the Vivo harvester from Python with Pyjnius
"""
Use the Vivo harverster with Python and Jnius.
You need to set the Java classpath before running this.
e.g.
export CLASSPATH=".:/work/javalib/*"
The path you specify needs to contain the Vivo Harvester jar.
https://github.com/vivo-project/VIVO-Harvester
@stefanozanella
stefanozanella / cnxsoft.md
Last active June 12, 2023 23:05
Emulate a Raspberry Pi with Qemu+ KVM

Booting with CNXSoft image

Reference: http://www.cnx-software.com/2012/07/31/84-mb-minimal-raspbian-armhf-image-for-raspberry-pi/

curl -O https://dl.dropbox.com/u/45842273/2012-07-15-wheezy-raspian-minimal.img.7z

yum install p7zip
7za e 2012-07-15-wheezy-raspian-minimal.img.7z

qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1" -hda 2012-07-15-wheezy-raspian-minimal.img -net nic -net user -vnc :0 -net tap,ifname=vnet0,script=no,downscript=no
@deviantintegral
deviantintegral / oauth.php
Created April 30, 2013 13:44
Example of simple 0-legged oauth request signing.
<?php
/**
* Sign a request to the Hackpad API using oauth 1.0. The Hackpad API doesn't
* use tokens or anything beyond a very basic oauth request.
*
* @params $uri
* The URI to make the request to.
* @param $method
* The HTTP method used for the request.
* @param $query