Skip to content

Instantly share code, notes, and snippets.

View gipi's full-sized avatar
😎
code for food

Gianluca Pacchiella gipi

😎
code for food
View GitHub Profile
@gipi
gipi / local_settings.py
Created October 31, 2011 08:54
Configure a Django project to use a specific database to use when run tests if we can't create databases with the user credential defined in the 'default' one
# Since we need a syncdb on all the databases, before the tests can be
# runned successfully we need to execute
#
# $ python manage.py syncdb
# $ python manage.py syncdb --database=test
#
# otherwise will be errors like
#
# 'django.db.utils.DatabaseError: no such table: django_site'
@gipi
gipi / Manifest.plist
Created October 21, 2011 13:09
Creating a home page to download an In House ad hoc iphone application
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
@gipi
gipi / repo-apply.sh
Last active April 4, 2023 05:10
Split a patch created with repo diff in a set of usable patches
#!/bin/sh
## Script to patch up diff reated by `repo diff`
# from https://groups.google.com/d/msg/repo-discuss/43juvD1qGIQ/7maptZVcEjsJ
if [ -z "$1" ] || [ ! -e "$1" ]; then
echo "Usages: $0 <repo_diff_file>";
exit 0;
fi
rm -fr _tmp_splits*
@gipi
gipi / roundcube
Created December 28, 2011 10:49
ROUNDCUBE: Init script for PHP CGI and nginx configuration file.
#!/bin/sh
### BEGIN INIT INFO
# Provides: php-cgi
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Make available a cgi for nginx
# Description: primarly is used for the wordpress installation
### END INIT INFO
@gipi
gipi / matrix.pdf
Last active April 14, 2022 07:34
Algorithmic thinking - Living quality diagram
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gipi
gipi / ImageViewExtended.java
Created November 25, 2011 14:56
Android: class to download remote resources and implemente Observer pattern and a simple extension of ImageView that use it.
package com.example.android;
import android.content.Context;
import android.widget.ImageView;
import android.util.AttributeSet;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.view.animation.AnimationUtils;
import android.view.animation.Animation;
@gipi
gipi / gist:2401143
Created April 16, 2012 20:04 — forked from anonymous/gist:476058
Multi columns django custom field
#look also
# https://github.com/dcramer/django-ratings/blob/master/djangoratings/fields.py
from django.core.exceptions import ValidationError
from django.db.models import Field, CharField
__all__ = ['MultiColumnField']
try:
from hashlib import md5
@gipi
gipi / note.cpp
Created July 1, 2012 13:42
Cef JS Extension
#include <cstdlib>
#include <string>
#include "include/cef_v8.h"
#include "cefclient/js_user_notes.h"
#include "cefclient/sqlcipher.h"
class Note : public Cipher {
public:
Note(){Initialize("note.db", "");}
~Note() {};