Skip to content

Instantly share code, notes, and snippets.

@pazdera
pazdera / gist:1098129
Created July 21, 2011 20:29
Singleton example in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Example of Singleton design pattern
# Copyright (C) 2011 Radek Pazdera
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@yustam
yustam / redis.config
Last active December 16, 2023 06:45
Install Redis on Elastic Beanstalk
packages:
yum:
gcc-c++: []
make: []
sources:
/home/ec2-user: http://download.redis.io/releases/redis-2.8.4.tar.gz
commands:
redis_build:
command: make
cwd: /home/ec2-user/redis-2.8.4
@lexruee
lexruee / bluetooth raspberry-pi
Created January 22, 2015 05:12
install bluetooth and pybluez
sudo apt-get update
sudo apt-get install python-pip python-dev ipython
sudo apt-get install bluetooth libbluetooth-dev
sudo pip install pybluez
@jslefche
jslefche / README.md
Last active May 29, 2022 00:23
ggplot2: theme_black()

Black theme for ggplot2

This is an additional theme for ggplot2 that generates an inverse black and white color scheme.

Example

ggplot(mtcars, aes(wt, mpg)) + geom_point()
# Add theme_black()
ggplot(mtcars, aes(wt, mpg)) + geom_point(color = "white") + theme_black()
@trandaison
trandaison / starUML.md
Last active July 20, 2024 19:34
Get full version of StarUML
@keremistan
keremistan / structurel_induction_example.py
Created November 26, 2019 16:22
A python program that finds possible solutions for a given function in propositional calculus. This program checks automatically all the combinations whether there are suitable combinations for variables that validate the new formel. That is best used in the induction step (Induktionsschritt in German) in a structural induction (Strukturelle Ind…
# To decipher the result,
# 0 -> theta
# 1 -> not theta
# 2 -> psi
# 3 -> not psi
def and_op(theta, psi):
return theta and psi
def or_op(theta, psi):