Skip to content

Instantly share code, notes, and snippets.

View benzkji's full-sized avatar
🐙
eight times a thing

Ben Stähli benzkji

🐙
eight times a thing
  • bnzk GmbH
  • Biel/Bienne Switzerland
View GitHub Profile
@wullerot
wullerot / admin.py
Last active October 14, 2017 09:19
django-modeltranslation-language-tabs
from __future__ import unicode_literals
from django.conf import settings
class LanguageTabsMixin(object):
change_form_template = 'admin/modeltranslation/change_form.html'
def change_view(self, request, object_id, form_url='', extra_context=None):
context = extra_context or {}
@jgamblin
jgamblin / urls.txt
Created July 6, 2016 12:00
Top 1000 Domains
google.com
youtube.com
facebook.com
baidu.com
yahoo.com
amazon.com
wikipedia.org
google.co.in
twitter.com
qq.com
@beci
beci / gcc 5 on ubuntu 14.04
Created October 15, 2015 07:18
use gcc 5.x on ubuntu 14.04
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
@danharper
danharper / gulpfile.js
Last active September 25, 2024 09:04
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@mojaray2k
mojaray2k / jsbin.burut.html
Last active September 19, 2023 15:42
CSS only custom-styled select Todd Parker - Filament Group Inc. How this works: This styles a native select consistently cross-platform with only minimal CSS. The native select is then styled so it is essentially invisible (no appearance, border, bg) leaving only the select's text visible. There is a wrapper around the select that has the majori…
<html>
<head>
<title>Select styles with CSS only</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
background-color: #fff;
font-family: helvetica, sans-serif;
margin: 4% 10%
}
this is over 8 years old, see revisions if you really want to see it
@staltz
staltz / introrx.md
Last active November 14, 2024 11:27
The introduction to Reactive Programming you've been missing
@stefanfoulis
stefanfoulis / 0001_old_migration.py
Last active June 13, 2016 08:38
reliably upgrading my plugins to the new django-cms 3.0 table names
"""
Do not rename the table for plugins in the first "create" migration.
OR: if you do... make the create table statement only run if the table does not already exist.
"""
class Migration():
def forwards(self, orm):
# ...
@benzkji
benzkji / gist:cb889e5a54c749452f01
Last active August 24, 2017 07:50
my current fabfile for django deployement on djangoeurope.com (nginx / gunicorn)
from fabric.api import task, env, run, local, roles, cd, execute, hide, puts,\
sudo
import posixpath
import re
env.forward_agent = True
env.project_name = 'parkhotel' # var
env.repository = '[email protected]:benzkji/bnzk_{project_name}.git'.format(**env)
env.local_branch = 'master'
env.remote_ref = 'origin/master'
@manufaktor
manufaktor / application.js
Last active December 23, 2015 08:19
Custom events with ember.js and hammer.js
App = Ember.Application.create({
customEvents: {
swipeLeft: 'swipeLeft',
swipeRight: 'swipeRight',
swipeLeftTwoFinger: 'swipeLeftTwoFinger',
swipeRightTwoFinger: 'swipeRightTwoFinger',
dragDown: 'dragDown',
dragUp: 'dragUp',
dragDownTwoFinger: 'dragDownTwoFinger',
dragUpTwoFinger: 'dragUpTwoFinger'