Skip to content

Instantly share code, notes, and snippets.

View horiajurcut's full-sized avatar

Horia Jurcut horiajurcut

View GitHub Profile
@horiajurcut
horiajurcut / CODE-LICENSE.txt
Created September 8, 2026 21:06
Lap Logic Garage: Spa Kemmel and Les Combes source data and reconstruction (2026 reference)
MIT License
Copyright (c) 2026 Lap Logic Garage
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
#include <iostream>
#include <string>
using String = std::string;
class Entity {
private:
mutable int m_GetCount;
int m_Age;
String m_Name;
@horiajurcut
horiajurcut / hangman.cpp
Created April 15, 2019 13:32
Hangman CPP
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include <vector>
const int dictionarySize = 5;
const char* dictionary[dictionarySize] = {
"programming",
"encouragement",
"possibility",
@horiajurcut
horiajurcut / references.rs
Created May 6, 2018 19:44
Rust References
fn main() {
println!("References");
let mut alpha = String::from("hello");
let len = calculate_length(&alpha);
println!("The length of '{}' is {}.", alpha, len);
change(&mut alpha);
class QuickFindUF:
def __init__(self, n):
self.id = []
for i in range(0, n):
self.id.append(i)
def connected(self, p, q):
return self.id[p] == self.id[q]
class QuickFindUF:
def __init__(self, n):
def connected(self, p, q):
def union(self, p, q):
# In the model you decide what to expose
__collections__ = [Bookmark]
# In the Model View base class the relationship is exposed
@route('/<int:entity_id>')
@route('/<int:entity_id>/<string:relationship>')
def get(self, entity_id, relationship=None):
query = self.model.query
from flask.ext.classy import route
class ModelView(BaseView):
@route('/<int:entity_id>')
@route('/<int:entity_id>/<string:relationship>')
def get(self, entity_id, relationship=None):
# Available routes will be:
# http://domain.com/<prefix>/<model_view_subclass>/<id>
# http://domain.com/<prefix>/<model_view_subclass>/<id>/<relationship>
for endpoint in ModelView.__subclasses__():
def relationships(self, id):
print id
for key in endpoint.model.__dict__:
if key.endswith('_id'):
setattr(endpoint, 'related_%s' % (key), types.MethodType(
route(
rule='/<id>/related_%s' % (key),
endpoint='related_%s' % (key),
import json
from functools import wraps
from flask import request
from utils.exceptions import HttpNotFound
from utils.validators import Required
def require(f):
@wraps(f)