Skip to content

Instantly share code, notes, and snippets.

import json
from sys import argv
if len(argv) < 2:
exit("usage: {} filename".format(argv[0]))
filename = argv[1]
f = open(filename)
line = f.readline()
f.close()
@chraibi
chraibi / makeini.py
Last active February 14, 2020 13:30
Makeini for JuPedSim with Jinja
#!/usr/bin/env python
import os
import itertools
from jinja2 import Environment, FileSystemLoader
PATH = os.path.dirname(os.path.abspath(__file__))
TEMPLATE_ENVIRONMENT = Environment(
autoescape=False,
loader=FileSystemLoader(PATH),
trim_blocks=False)
@chraibi
chraibi / README.md
Created December 31, 2019 08:32
Readme template for jpscore demos

Description

What do we learn from this demo? (e.g. this demo showcases feature X, etc)

Settings

What are the models used in this demo? (with links to the online documentation)

  • Model: i
  • Router: xyz
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chraibi
chraibi / IoC-and-DI-with-Castle-Windsor-Container-part-1.md
Created May 21, 2019 09:39 — forked from jermspeaks/IoC-and-DI-with-Castle-Windsor-Container-part-1.md
Inversion of Control and Dependency Injection with Castle Windsor Container

Inversion of Control and Dependency Injection with Castle Windsor Container - Part I

Published: 24 Jul 2007.
By: Simone Busoli

Inversion of Control (IoC) and Dependency Injection (DI) are two related practices in software development which are known to lead to higher testability and maintainability of software products. While some people employ them daily in their work, many others still don't know much about them, mostly because they require in the former a shift in the usual thinking process.

This article introduces these notions in a simple and affordable fashion, with a real example which evolves step by step to take advantage from IoC and DI, leveraging the features offered by an open source framework called Castle Project.

Inversion of Control/Dependency Injection Series

@chraibi
chraibi / bobp-python.md
Created January 30, 2018 23:31 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@chraibi
chraibi / note.md
Created March 14, 2017 13:45
clang and openmp in Mac OS X

Refer to https://clang-omp.github.io/ .

We need to install something:

brew install libiomp
brew install clang-omp

Then we need to set the environment:

@chraibi
chraibi / initial.sh
Created November 21, 2016 16:13
Setting up GitLab with Docker
# If you already have a webserver running you most likely won't be able to get GitLab
# woring on ports 80 and 443. Port 22 should work because we change the default SSH
# port on the host during server provisioning.
HTTP_PORT=8080
HTTPS_PORT=8443
SSH_PORT=22
# Install Docker (don't use Ubuntu's repositories, they're out of date).
wget -qO- https://get.docker.com/ | sudo sh
@chraibi
chraibi / osx-10.11-setup.md
Created October 30, 2016 07:13 — forked from kevinelliott/osx-10.11-setup.md
Mac OS X 10.11 El Capitan Setup

Mac OS X 10.11 El Capitan

Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.10 Yosemite setup recipe (as found on this gist https://gist.github.com/kevinelliott/0726211d17020a6abc1f). Note that I expect this to change significantly as I install El Capitan several times.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.