Skip to content

Instantly share code, notes, and snippets.

View OliverUv's full-sized avatar

Oliver Uvman OliverUv

View GitHub Profile
Parallel
08 Fö 3
09 Fö 4
Fö 5
10 Fö 6
12 LE 1
15 LA 1 AC
16 FÖ 7
LA 1 B
-- GistID: 5038439
data Term
= TmTrue
| TmFalse
| TmZero
| TmIf Term Term Term
| TmSucc Term
| TmPred Term
| TmIsZero Term
| PreviousWasNormalForm
#!/usr/bin/env python
# encoding: utf-8
# GistID: 4676361
import re
from operator import itemgetter
def get_tracks_by_popularity(no_tracks, track_provider, no_matches):
'''
Retrieves the most popular tracks.
" Save, quit, etc
nnoremap <silent> <leader>s :w<cr>
nnoremap <silent> <leader>w :wa<cr>
nnoremap <silent> <leader>x :wq<cr>
nnoremap <silent> <leader>d :q<cr>
nnoremap <silent> <leader>c :qa<cr>
" Disable Ex mode
map Q <Nop>
GistID: 4515800
Replacement for seemingly shitty autoclose
https://github.com/Raimondi/delimitMate
Replacement for ultrapooty Snipmate
https://github.com/guns/ultisnips
Replacement for pooty SuperTab (this is some seriously cool shit! also still maintained)
https://github.com/Shougo/neocomplcache
from booking.models import User, Remark, ResourceType, Resource, Reservation
from django.contrib import admin
# Used instead of admin.ModelAdmin for translated models.
from hvad.admin import TranslatableAdmin
class ResourceTypeAdmin(TranslatableAdmin):
fields = ['image', 'type_name']
admin.site.register(User)
exception_message_on_failure = ''
try:
exception_message_on_failure = 'Could not access database.'
neurons = database.query(Neurons, state='Firing')
exception_message_on_failure = 'Failed doing some thing.'
some.thing()
exception_message_on_failure = 'Could not format data.'
output = format(neurons)
<?php
/*
I've included below some example JSON output from this script. First,
a couple of normal treenodes, then a connector with no pre- or post-
synaptic relationships, finally a connector with some of both:
[
{
# assumes:
# X >= Y >= Z (will work otherwise, but suboptimally)
turn_switch = False
def switch():
if turn_switch:
turn_switch = False
else:
turn_switch = True
$canEdit = $db->getResult(
'SELECT "textlabel"."id" AS "tid"
FROM "textlabel" INNER JOIN "project"
ON "project"."id" = "textlabel"."project_id" INNER JOIN "project_user"
ON "project"."id" = "project_user"."project_id"
WHERE "textlabel"."id" = '.$tid.' AND
"project_user"."user_id" = '.$uid.' AND
"project_user"."project_id" = '.$pid );