Skip to content

Instantly share code, notes, and snippets.

View JeroenDM's full-sized avatar

Jeroen JeroenDM

  • KU Leuven
  • Belgium
View GitHub Profile
@nikhilkumarsingh
nikhilkumarsingh / paint.py
Created November 3, 2017 16:26
A simple paint application using tkinter in Python 3
from tkinter import *
from tkinter.colorchooser import askcolor
class Paint(object):
DEFAULT_PEN_SIZE = 5.0
DEFAULT_COLOR = 'black'
def __init__(self):
@mrkline
mrkline / parent-polymorphism.cpp
Last active May 13, 2022 08:08
Sean Parent's polymorphism demo
// See http://sean-parent.stlab.cc/presentations/2016-10-10-runtime-polymorphism/2016-10-10-runtime-polymorphism.pdf
// or an earlier version, "Inheritance Is The Base Class of Evil"
#include <iostream>
#include <memory>
#include <string>
#include <vector>
using namespace std;
@Nilpo
Nilpo / Using Git to Manage a Live Web Site.md
Last active April 26, 2024 19:09
Using Git to Manage a Live Web Site

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents

@learncodeacademy
learncodeacademy / pubsub.js
Created July 29, 2015 02:54
Basic Javascript PubSub Pattern
//events - a super-basic Javascript (publish subscribe) pattern
var events = {
events: {},
on: function (eventName, fn) {
this.events[eventName] = this.events[eventName] || [];
this.events[eventName].push(fn);
},
off: function(eventName, fn) {
if (this.events[eventName]) {
@nlap
nlap / graph-tool-ubuntu.md
Last active January 3, 2022 21:07
graph-tool on Ubuntu 14.04

graph-tool on Ubuntu 14.04

Recommended: Graph-tool one-line install commands:

anaconda conda create --name gt -c conda-forge graph-tool

homebrew brew install graph-tool

@iondune
iondune / SimpleOpenGL.cpp
Created January 28, 2015 19:28
Simple OpenGL sample using GLEW and GLFW
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <iostream>
#include <string>
void PrintOpenGLErrors(char const * const Function, char const * const File, int const Line)
{
@Sythelux
Sythelux / Square.cpp
Last active July 25, 2022 19:13
Example GLFW,C++,OpenGL,GLEW Program
/******************************
*
* Example "Square"
* created by Syd
*
*******************************/
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <cstdlib>
@electronut
electronut / ldr.py
Created May 4, 2014 06:14
Display analog data from Arduino using Python (matplotlib animation)
"""
ldr.py
Display analog data from Arduino using Python (matplotlib)
Author: Mahesh Venkitachalam
Website: electronut.in
"""
import sys, serial, argparse