Skip to content

Instantly share code, notes, and snippets.

View rla's full-sized avatar

Raivo Laanemets rla

View GitHub Profile
:- use_module(library(gensym)).
:- dynamic student/3.
do_stuff:-
gensym(student, S1),
gensym(student, S2),
assertz(student(S1, john, doe)),
assertz(student(S2, jane, doe)).
show_id_of_john :-
@rla
rla / nodepgsql2.js
Last active August 29, 2015 14:07 — forked from FernandoBasso/prog.cpp
var http = require('http');
var pg = require('pg');
var constr = 'postgres://devel:1234@127.0.0.1/tcc';
var total = 0;
setInterval(function() {
console.log('Total connect ' + total);
digit(D) --> [D],{member(D, `0123456789`)}.
digits([D]) --> digit(D).
digits([D|Ds]) --> digit(D), digits(Ds).
number_term(N) --> digits(D), {number_codes(N, D)}.
infix_op(add) --> `+`.
infix_op(sub) --> `-`.
@rla
rla / code.js
Last active August 29, 2015 13:55
var geocoder = require('geocoder');
var Promise = require('bluebird');
function query(location) {
console.log("Geocoding: %s", location);
var locator = Promise.defer();
geocoder.geocode(location, function(err, data) {
if (err !== null || data.results === undefined || data.results.length < 1) {
console.log("%s results: false", location);
@rla
rla / nginx.conf
Created December 2, 2013 14:13 — forked from jqr/nginx.conf
# Nginx cache busting rewriter, best used on assets that have long-lived expires.
#
# Rewrites like so:
# blah.com/release_ab2ea212312.../file.css => blah.com/file.css
#
location ~ ^/release_(.*?)/ {
rewrite ^/release_(.*?)/(.*)$ /$2 last;
}