start new:
tmux
start new with session name:
tmux new -s myname
| from django.contrib.sessions.backends.base import SessionBase, CreateError | |
| from django.conf import settings | |
| from django.utils.encoding import force_unicode | |
| import redis | |
| class SessionStore(SessionBase): | |
| """ Redis store for sessions""" | |
| def __init__(self, session_key=None): | |
| self.redis = redis.Redis( |
| function slugify(text) | |
| { | |
| return text.toString().toLowerCase() | |
| .replace(/\s+/g, '-') // Replace spaces with - | |
| .replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
| .replace(/\-\-+/g, '-') // Replace multiple - with single - | |
| .replace(/^-+/, '') // Trim - from start of text | |
| .replace(/-+$/, ''); // Trim - from end of text | |
| } |
| [ | |
| {name: 'Afghanistan', code: 'AF'}, | |
| {name: 'Åland Islands', code: 'AX'}, | |
| {name: 'Albania', code: 'AL'}, | |
| {name: 'Algeria', code: 'DZ'}, | |
| {name: 'American Samoa', code: 'AS'}, | |
| {name: 'AndorrA', code: 'AD'}, | |
| {name: 'Angola', code: 'AO'}, | |
| {name: 'Anguilla', code: 'AI'}, | |
| {name: 'Antarctica', code: 'AQ'}, |
| # gist: https://gist.github.com/4397792 | |
| # Usage: | |
| # session = cgd.CgdSession(uid, password) | |
| # session.login() | |
| # session.load_latest_transactions(account_key) | |
| # 'session.known_accounts' is now populated with the initial accounts taken from the login response, | |
| # and the data for the 'account_key' account. | |
| # session.load_latest_transactions(account_key) loads the latest transactions and balances for a given account. |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
| from functools import update_wrapper | |
| from django.contrib import admin | |
| from django.contrib.admin import ModelAdmin | |
| from django.contrib.admin.templatetags.admin_urls import add_preserved_filters | |
| from django.core.exceptions import PermissionDenied | |
| from django.shortcuts import render | |
| from myapp.models import Widget | |
| from myapp.forms import ManageWidgetForm |
| #!/bin/sh -x | |
| # This script compiles Godot for GNU/Linux in 64-bit. | |
| # Place this script at the root of your Godot Git clone. | |
| # CC0 1.0 Universal | |
| # Build 64-bit Godot for GNU/Linux desktop, in debug and release mode | |
| scons p=x11 -j$(nproc) verbose=no tools=yes target=release_debug openssl=builtin | |
| scons p=x11 -j$(nproc) verbose=no tools=no target=release_debug openssl=builtin |
| var canvas = document.createElement('canvas'); | |
| var gl; | |
| var debugInfo; | |
| var vendor; | |
| var renderer; | |
| try { | |
| gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl'); | |
| } catch (e) { | |
| } |