Skip to content

Instantly share code, notes, and snippets.

View cstrap's full-sized avatar
🐍

Christian Strappazzon cstrap

🐍
View GitHub Profile
@cstrap
cstrap / Vagrantfile
Created March 7, 2016 17:43 — forked from gabrielelana/Vagrantfile
How to create a VirtualBox machine with encrypted storage with Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
PASSWORD_PATH = ".password"
PASSWORD_ID_PATH = ".password_id"
# Make sure to have installed vagrant-triggers plugin
# > vagrant plugin install vagrant-triggers
# After the first `vagrant up` stop the VM and execute the following steps
@cstrap
cstrap / bobp-python.md
Created November 17, 2015 08:29 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@cstrap
cstrap / search.py
Created November 9, 2015 11:37 — forked from frague59/search.py
search features with attachment supports
# -*- coding: utf-8 -*-
"""
Search features for an elasticsearch / haystack / elasticstack
:creationdate: 05/11/15 15:05
:moduleauthor: François GUÉRIN <[email protected]>
:modulename: intrautils.search
"""
import base64
@cstrap
cstrap / introrx.md
Created October 16, 2015 16:09 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@cstrap
cstrap / django_haystack_testing.py
Last active September 14, 2018 13:07 — forked from justquick/django_haystack_testing
Django haystack testing index
import haystack
from django.core.management import call_command
from django.test.utils import override_settings
TEST_INDEX = {
'default': {
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL': 'http://127.0.0.1:9200/',
"""
Script to identify accounts followed older than 4 months.
Source blogpost: http://www.rainbowbreeze.it/identify-your-twitter-followings-older-that-4-months
"""
import tweetpony
from datetime import timedelta, datetime
import urllib3.contrib.pyopenssl
import time
#!/usr/bin/env python
#
# Converts any integer into a base [BASE] number. I have chosen 62
# as it is meant to represent the integers using all the alphanumeric
# characters, [no special characters] = {0..9}, {A..Z}, {a..z}
#
# I plan on using this to shorten the representation of possibly long ids,
# a la url shortenters
#
<VirtualHost *>
ServerName example.com
WSGIDaemonProcess www user=max group=max threads=5
WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi
<Directory /home/max/Projekte/flask-upload>
WSGIProcessGroup www
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
/*
* Android API Guide
* http://developer.android.com/guide/topics/ui/actionbar.html
* Android Design Guide
* http://developer.android.com/design/patterns/actionbar.html
* Titanium Mobile will support someday
* https://jira.appcelerator.org/browse/TIMOB-2371
*/
var osName = Ti.Platform.osname,
isAndroid = osName==='android',
var currentWin = Ti.UI.currentWindow;
// below example would require variable declarations for Name, Description, image, Lat, Longitude
// Docs:
// http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Map.Annotation-object
// http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Map.MapView-object
//
// CREATE MAP VIEW
//