Skip to content

Instantly share code, notes, and snippets.

View efoken's full-sized avatar
🏠
Working from home

Eike Foken efoken

🏠
Working from home
View GitHub Profile
@efoken
efoken / gist:2950942
Created June 18, 2012 21:50
Django snippet to make user emails unique
User._meta.local_fields[4].__dict__['_unique'] = True
@efoken
efoken / _linear-gradient.scss
Last active June 1, 2018 11:33
Sass mixin for CSS linear gradients with SVG fallback to support IE9.
@function inverse-side($side) {
@if $side == top {
@return bottom;
} @else if $side == bottom {
@return top;
} @else if $side == left {
@return right;
}
@return left;
}
@efoken
efoken / email-obfuscation.php
Last active December 31, 2015 20:28
WordPress email obfuscation
<?php
/**
* Live email obfuscation using the "otliam" CSS module.
*
* @package eMSN
*/
define( 'EMSN_OTLIAM_REPLACE_ALWAYS', serialize( array( '.', '@' ) ) );
/**
* Filters most content to obfuscate appearing email addresses.
<?php
define('LASTFM_API_KEY', 'xxx');
function callApi($url, $data = false)
{
$curl = curl_init();
if ($data) {
$url = sprintf('%s?%s', $url, http_build_query($data));
}
curl_setopt($curl, CURLOPT_URL, $url);
@efoken
efoken / example.nginxconf
Last active August 29, 2015 14:04
nginx.conf for Django projects
upstream django {
server unix:///tmp/example.com.sock;
}
server {
server_name www.example.com example.com;
rewrite ^ https://example.com$request_uri? permanent;
}
server {
@efoken
efoken / # php - 2018-03-14_16-15-13.txt
Created March 16, 2018 12:10
php on macOS 10.13.3 - Homebrew build logs
Homebrew build logs for php on macOS 10.13.3
Build date: 2018-03-14 16:15:13