Skip to content

Instantly share code, notes, and snippets.

View diegogangl's full-sized avatar

Diego Gangl diegogangl

View GitHub Profile

About this guide

This is a brief introduction to Lojban, a constructed human language. It has a very nice, fun, regular grammar that computers and humans alike can understand easily.

Basic grammar

All Lojban words are either particles (tiny words that help the grammar) or verbs (which tell us how nouns relate).

A Lojban sentence consists of a main verb with a bunch of nouns plugged into it.

A Lojban verb definition looks like this:

@mikoim
mikoim / README.md
Last active April 27, 2024 00:22
[Updated! Aug 14 2020] YouTube recommended encoding settings on ffmpeg (+ libx264)

Parameters

Container: MP4

Parameter YouTube recommends setting
-movflags faststart moov atom at the front of the file (Fast Start)

Video codec: H.264

@flying-sheep
flying-sheep / plasmoid-tempinstall-run.sh
Last active December 6, 2018 14:28
installs and runs a plasmoid with a plugin
#!/bin/sh
#usage: ./plasmoid-tempinstall-run.sh plasmoidname
export QML2_IMPORT_PATH="$HOME/.local/share/qml"
myplasmoid=$1
mysopath="$QML2_IMPORT_PATH/org/kde/plasma/private/$myplasmoid"
if [[ -d "$HOME/.local/share/plasma/plasmoids/org.kde.plasma.$myplasmoid" ]]; then
plasmapkg2 -u ./package
@lifthrasiir
lifthrasiir / no-box.md
Last active June 27, 2017 08:46
Idiomatic Rust: Yes I'm really trying to write something similar

No Box<T>

tl;dr: Avoid Box<T> in general.

Actually, this rule is so important that the Rust Pointer Guide explicitly says the same. Therefore without a further ado, you should avoid Box<T> except for these three cases:

  1. When you absolutely need a trait object (Box<Trait>). But review carefully to see if it is indeed absolutely needed; you may try to generalize things too far, for example.

  2. When you have a recursive data structure. This may be mandatory when you have an inherently recursive data (e.g. scene graph), but it may also be a sign of the premature optimization. Again, review carefully to see if you need to write a separate data structure yourself, and use the collection crate if possible.

@mariocesar
mariocesar / app_granite.py
Last active June 29, 2021 08:35
Python GTK3 desktop app and Granite App (Elementary OS Desktop)
import sys
from gi.repository import Granite
from gi.repository import Gtk
from gi.repository import Gio
class LightWindow(Gtk.Dialog):
def __init__(self):
super(LightWindow, self).__init__()
@snim2
snim2 / pre-commit.py
Created September 5, 2013 00:50
A git pre-commit hook to test Python code for PEP8 compliance, and run unit tests via the pytest framework
#!/usr/bin/env python
"""
Git pre-commit hook to enforce PEP8 rules and run unit tests.
Copyright (C) Sarah Mount, 2013.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
@killercup
killercup / pandoc.css
Created July 3, 2013 11:31
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@sergejx
sergejx / gist:2358089
Created April 11, 2012 08:59
Set dark theme for GTK+ application
from gi.repository import Gtk
settings = Gtk.Settings.get_default()
settings.set_property("gtk-application-prefer-dark-theme", True)
@diegogangl
diegogangl / currentTaxonomy.php
Created April 10, 2012 13:30
[Wordpress 3.3] I've found that wp_list_categories doesn't highlight the current category if it's a taxonomy term (and you're in a taxonomy archive), this little snippet fixes that.
<?php
// Get the term id first
$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
$currentTerm = $term->term_taxonomy_id;
// This is how you'd use it in your template
wp_list_categories( array(
'taxonomy' => 'YOUR_TAXONOMY',
@indragiek
indragiek / NSView-SNRAdditions.m
Created September 11, 2011 03:11
Animated NSView redraws + scrolling
@implementation NSView (SNRAdditions)
- (void)scrollPointAnimated:(NSPoint)point
{
NSScrollView *scrollView = [self enclosingScrollView];
NSClipView *clipView = [scrollView contentView];
NSPoint constrainedPoint = [clipView constrainScrollPoint:point];
[NSAnimationContext beginGrouping];
[[NSAnimationContext currentContext] setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[[clipView animator] setBoundsOrigin:constrainedPoint];
[NSAnimationContext endGrouping];