Skip to content

Instantly share code, notes, and snippets.

View Kronuz's full-sized avatar

Germán Méndez Bravo Kronuz

View GitHub Profile
@Kronuz
Kronuz / geospatial-to-1.2.12.diff
Created September 12, 2012 20:48
Geospatial support backported from 1.3.0 (only python bindings tested/work atm)
diff --git a/xapian-bindings/xapian.i b/xapian-bindings/xapian.i
index 7b608e4..25ea850 100644
--- a/xapian-bindings/xapian.i
+++ b/xapian-bindings/xapian.i
@@ -202,6 +202,7 @@ class ValueIterator {
%ignore Xapian::PostingSource::clone;
%ignore Xapian::PostingSource::serialise;
%ignore Xapian::PostingSource::unserialise;
+%ignore Xapian::PostingSource::unserialise_with_registry;
%ignore Xapian::PostingSource::register_matcher_;
#!/bin/sh
#
# This takes the first rule and makes it randomly active across the day in several rules
#
# For tomato router
# http://infinilogix.com/wordpress/category/network-programming
#
# 1|540|1140|62|||block-site.com$|0|New Rule 1
# Let us take a closer look at what each of these nine fields separated by pipe (|) means.
# The first field shows whether the rule is currently enabled or disabled – 1 means enabled, 0 means disabled.
@Kronuz
Kronuz / gist:3923317
Created October 20, 2012 13:47
pil formula not depending on x11
--- a/Library/Formula/pil.rb
+++ b/Library/Formula/pil.rb
@@ -5,7 +5,7 @@ class Pil < Formula
homepage 'http://www.pythonware.com/products/pil/'
sha1 '76c37504251171fda8da8e63ecb8bc42a69a5c81'
- depends_on :x11
+ # depends_on :x11
depends_on 'jpeg' => :recommended
depends_on 'little-cms' => :optional
@Kronuz
Kronuz / gist:3923320
Created October 20, 2012 13:48
gnuplot formula not depending on x11
--- a/Library/Formula/gnuplot.rb
+++ b/Library/Formula/gnuplot.rb
@@ -19,8 +19,8 @@ class Gnuplot < Formula
depends_on 'pkg-config' => :build
depends_on 'readline'
- depends_on 'pango'
- depends_on :x11
+ # depends_on 'pango'
+ # depends_on :x11
@Kronuz
Kronuz / Multi-table inheritance in django-denorm
Last active December 14, 2015 13:09
This adds some multi-table inheritance to django-denorm
--- django-denorm/denorm/dependencies.py
+++ django-denorm/denorm/dependencies.py
@@ -260,7 +260,7 @@ class CallbackDependOnRelated(DependOnRelated):
model=DirtyInstance,
columns=("content_type_id", "object_id"),
values=triggers.TriggerNestedSelect(
- self.this_model._meta.db_table,
+ self.this_model._meta.pk.model._meta.db_table,
(content_type,
self.this_model._meta.pk.get_attname_column()[1]),
#include <iostream>
// c++ -std=c++14 -fsanitize=address -Wall -Wextra -g -o tst test_stash.cpp && ./tst
#include <array> // for array
#include <atomic> // for atomic
class StashException { };
class StashContinue : public StashException { };
class StashEmptyBin : public StashContinue { };
@Kronuz
Kronuz / compiler.sh
Last active April 4, 2018 18:12
Compiler selector for macOS
compiler() {
# After installing compilers in macOS:
# brew install gcc gcc@4.9 gcc@5 gcc@6 llvm@3.9 llvm@4 llvm@5
# Use compiler <compiler> to select it. Ex.:
# compiler llvm@5
compiler=$1
if [ -z "$compiler" ]; then
if [ -z "$COMPILER" ]; then
@Kronuz
Kronuz / profile
Created April 5, 2018 14:32
profile
#!/bin/sh
################################################################################
dubalu() {
if [ -z "$DUBALU_LEGEND" -o -n "$1" ]; then
if [ -t 1 -o "$1" = "color" ]; then
printf '\n'
printf ' \033[1;38;2;189;74;10m8888\033[0m \033[1;38;2;200;200;200m8888\033[0m \033[1;38;2;200;200;200m8888\033[0m \033[1;38;2;200;200;200m888\033[0m\n'
printf ' \033[1;38;2;189;74;10m8888888\033[0m \033[1;38;2;200;200;200m8888\033[0m \033[1;38;2;200;200;200m8888\033[0m \033[1;38;2;200;200;200m888\033[0m\n'
printf ' \033[1;38;2;189;74;10m888888K\033[0m \033[1;38;2;200;200;200m8888\033[0m \033[1;38;2;200;200;200m8888\033[0m \033[1;38;2;200;200;200m888\033[0m\n'
printf ' \033[1;38;2;189;74;10m8888888o.\033[0m \033[1;38;2;200;200;200mo8888888\033[0m \033[1;38;2;200;200;200m888\033[0m \033[1;38;2;200;200;200m888\033[0m \033[1;38;2;200;200;200m8888888o\033[0
module.exports = "Exported";
@Kronuz
Kronuz / C++.sublime-syntax
Created February 8, 2019 21:26
C++ syntax for Sublime Text with fmt formatting support in the strings
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: C++ (fmt)
comment: I don't think anyone uses .hp. .cp tends to be paired with .h. (I could be wrong. :) -- chris
file_extensions:
- cpp
- cc
- cp
- cxx