Skip to content

Instantly share code, notes, and snippets.

def sanitize_at_name(name, decode = False):
""" Sanitize achternaam, optionally decodes
to unicode string from AT input """
if decode:
name = unicode(name, 'iso-8859-15')
tussenvoegsels = [
"af",
"aan",
@eelkeh
eelkeh / gist:a987932e68e32bcb519c
Last active August 29, 2015 14:02
pseudo code cropping api
cmyk_high_res_rgb(pdf_full_path = filehandler):
return filehandler
split_pages(pdf_full_path = filehandler):
yield filehandler
crop_from_pdf(pdf_page_path = filehandler, coordinates = [(x,x2, y, y2), ...]):
filehandler.seek(0)
return filehandler (met pointer op 0)
@eelkeh
eelkeh / stickies
Created March 5, 2015 09:30
sticky headers
var $ = require('jquery');
module.exports = Stickies;
function Stickies(elems) {
console.log(elems);
this.load = function() {
elems.each(function(){
var thisSticky = $(this).wrap('<div class="follow-wrap" />');
thisSticky.parent().height(thisSticky.outerHeight());
@Radium
export default class ItemComponent extends React.Component {
render() {
return (
<div style={[
styles.base,
hasFutures && styles.hasFutures,
hasChanges && styles.hasChanges
]} className="ui segment grid">
@eelkeh
eelkeh / libgs_install.sh
Created November 17, 2015 13:07 — forked from masbog/libgs_install.sh
Installing ghostscript 9 CentOS 6.5 with shared Library
curl -O http://downloads.ghostscript.com/public/ghostscript-9.14.tar.gz &&
tar -xzf ghostscript-9.14.tar.gz &&
cd ghostscript-9.14 &&
./configure &&
make install &&
make so &&
cp ghostscript-9.14/sobin/libgs.so.9.14 /usr/lib &&
ln -s /usr/lib/libgs.so.9.14 /usr/lib/libgs.so &&
mkdir -p /etc/ld.so.conf.d/ &&
echo "/usr/lib/libgs.so" > /etc/ld.so.conf.d/libgs.conf &&
@eelkeh
eelkeh / gist:1b5d8a0628e716866010b2ddc4c1719d
Last active August 15, 2017 11:56
Contract REST user endpoint
PATCH /api/2/users/bar?access_token=foo
Accept: application/json
Content-Type: application/json
{ "subscriptions": [ { "_id": "1", "start": "2017-01-01T00:00:00Z", "end": "2017-01-01T00:00:00Z" } ] }
RETURN
204
@eelkeh
eelkeh / transaction.md
Created October 2, 2017 14:27
shizzle

ChatModel

attributes:

  • chatId
  • draft
  • searchResponse.search.query
  • searchResponse.user.firstName

Transaction

@eelkeh
eelkeh / django-tips.md
Created January 28, 2019 10:09
Django commands

Dump all when all database tabels are already installed on the target

$ python3 manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e auth.Permission -o dump_all.json

@eelkeh
eelkeh / error
Created December 22, 2019 13:44
error
2:41:21 PM: Waiting for other deploys from your team to complete
2:41:32 PM: Build ready to start
2:41:35 PM: build-image version: 9cade8af58c2cf3a17a1e9433d2e979149488837
2:41:35 PM: build-image tag: v3.3.5
2:41:35 PM: buildbot version: 2d05064ce3dd2eb95d282a24602ab707dd9581e8
2:41:35 PM: Fetching cached dependencies
2:41:35 PM: Starting to download cache of 376.0MB
2:41:36 PM: Finished downloading cache in 1.517902957s
2:41:36 PM: Starting to extract cache
2:41:45 PM: Finished extracting cache in 8.624281618s
@eelkeh
eelkeh / gist:8fd1c9877e0b0974dc2659b1dad14d30
Created March 4, 2020 15:54
Attaching volumes (Ubuntu)
sudo mkdir -m 000 /vol
echo "/dev/xvdf /vol auto noatime 0 0" | sudo tee -a /etc/fstab
sudo mount /vol