Skip to content

Instantly share code, notes, and snippets.

@davidrenne
davidrenne / install_robomongo.sh
Created September 20, 2016 12:42 — forked from sanderhouttekier/install_robomongo.sh
This file installs robomongo on your ubuntu / mint linux install
#!/bin/bash -e
# Script for installing Robomongo on Ubuntu.
# Copyright 2013 Binary Birch Tree
# http://www.binarybirchtree.com
# 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
@davidrenne
davidrenne / oh_hell.py
Last active May 15, 2016 21:24 — forked from usrlocalben/oh_hell.py
"oh hell!" card game logic
"""
"oh hell!" card game logic
(aka contract whilst)
benjamin yates & dave renne, 2016
renne house rules edition
"""
import sys
import random
from itertools import chain
var jsdom = require("jsdom").jsdom;
var document = jsdom('<!doctype html>' +
'<html>' +
' <head>' +
' <meta charset="utf-8" />' +
'<title>image triangulation experiment</title>' +
'<link rel="stylesheet" href="styles/main.css" />' +
'</head>' +
'<body data-defaultimage="lincoln.jpg">' +
' <div class="nav-wrapper dark-bg">' +
@davidrenne
davidrenne / gist:c427cee31a4665089e7d
Last active August 29, 2015 14:28
MAGIC CSS CROP
#sectionFeatures p img, #sectionDining p img {
width: 100%;
background-position: center;
background-size: cover;
}
#sectionDining p {
width: 306px;
height: 219px;
@davidrenne
davidrenne / Dumper.py
Last active August 29, 2015 14:24 — forked from passos/Dumper.py
"""
A perl Data.Dumper clone for Python
Author: simon@log4think.com
2011-07-08
"""
#!/bin/env python
import sys
from types import *
@davidrenne
davidrenne / gist:9471ba9b7a1f52e5199a
Created May 26, 2015 14:32
Be safe out there kids...
def tester(insert=False, value={}):
if insert:
value['insert'] = True
print(value)
tester(insert=False)
tester(insert=True)
tester(insert=False)
<span class="fa-stack fa-lg danger">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-times fa-stack-1x fa-inverse"></i>
</span>
@davidrenne
davidrenne / gist:c55a3de5c5014b239095
Last active August 29, 2015 14:21
startapp extras
PROJECT_NAME=XXXXXXXXXXXXXX
APP_NAME=api
BASE_DIR=$PROJECT_NAME/apps/$APP_NAME
mkdir -p $BASE_DIR
django-admin.py startapp $APP_NAME $BASE_DIR
mkdir -p $BASE_DIR/static/$APP_NAME/{css,js,img}
echo '' > $BASE_DIR/static/$APP_NAME/css/.gitkeep
echo '' > $BASE_DIR/static/$APP_NAME/js/.gitkeep
echo '' > $BASE_DIR/static/$APP_NAME/img/.gitkeep
mount c c:\ -t cdrom
c:\
(function(artoo) {
// Artoo Spider for http://www.immobiliare.it/info/ufficio-stampa
var scrape = {
iterator: '#wrapTestoStatiche',
data: {
'id': function() {
var id = artoo.$(this).find('.text-align_left a:last-child').attr('href');
if (id) {
id = id.match(/ImmoNews\-(\d+)\.pdf$/);