Skip to content

Instantly share code, notes, and snippets.

View geschke's full-sized avatar

Ralf Geschke geschke

View GitHub Profile
@geschke
geschke / gdrive-example.php
Created April 21, 2014 17:15
Google Drive PHP API library example to download a spreadsheet file
<?php
require_once __DIR__ . '/vendor/autoload.php';
class DriveFile
{
private $service = null;
private $client = null;
private $auth;
@geschke
geschke / redis-server.service
Last active January 10, 2021 20:11
WARNING. OUTDATED! The information on this page is severely out of date. Don't use it! Ubuntu systemd service file for Redis. The server was updated to a Ubuntu 15.04 (Vivid Vervet) distribution. Redis was installed from the PPA from Roman Wookey (https://launchpad.net/~rwky/+archive/ubuntu/redis). After the switch to systemd instead of Upstart,…
[Unit]
Description=Redis Datastore Server
After=network.target
[Service]
Type=forking
PIDFile=/var/run/redis/redis.pid
ExecStartPre=/bin/mkdir -p /var/run/redis
ExecStartPre=/bin/chown redis:redis /var/run/redis
@geschke
geschke / OwnServerlessPolicy
Created July 14, 2019 15:24
AWS IAM policy additional to AWSLambdaFullAccess and AmazonAPIGatewayAdministrator policies.
{
"Statement": [
{
"Action": [
"apigateway:*",
"cloudformation:CancelUpdateStack",
"cloudformation:ContinueUpdateRollback",
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
"cloudformation:CreateUploadBucket",
@geschke
geschke / gist:396572
Created May 10, 2010 21:25
JavaScript example code for Facebook login with Django Middleware
<!-- slightly modified example of Facebook Connect with JavaScript SDK
Requirements: jQuery, Django Facebook Middleware (see https://gist.github.com/396557)
-->
$(document).ready(function() {
// Logout link binding
$('#fb-logout').bind('click', function() {
FB.logout(function() {});
setTimeout(function() {
@geschke
geschke / pre-commit.php
Last active December 17, 2015 15:18
git post-commit hook to simulate revision numbers in current branch and replace $Revision$ with current number in all *.sql files. Please rename to "pre-commit" and place it into .git/hooks/ directory.
#!/usr/bin/php
<?php
$output = array();
$rootDirCurrent = getcwd();
exec('git rev-parse --show-toplevel',$rootDir);
$rootDir = implode($rootDir);
chdir($rootDir);
@geschke
geschke / FacebookConnectMiddleware.py
Created May 10, 2010 21:15
Django Middleware for Facebook integration. Slightly modified to work with newer versions of Python Facebook SDK from https://github.com/pythonforfacebook/facebook-sdk
# Facebook Connect Middleware with new Facebook Python SDK from https://github.com/pythonforfacebook/facebook-sdk and Graph API
#
# based on http://www.djangosnippets.org/snippets/1252/
#
from django.contrib.auth import authenticate, login, logout, get_user
from django.contrib.auth.models import User
from django.conf import settings
from kuerbisorg.comcore.models import ComUser, COUNTRY_CHOICES, ACTIVE_CHOICES
@geschke
geschke / composer.json
Last active August 29, 2015 14:00
Google Drive PHP Client example - composer.json
{
"require" : {
"google/apiclient": "dev-master"
}
}