Skip to content

Instantly share code, notes, and snippets.

View xjcl's full-sized avatar
👋
Say hi to me!

Jan-Frederik Konopka xjcl

👋
Say hi to me!
  • Düsseldorf, Germany
View GitHub Profile
unit ujff2;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
ExtCtrls, Menus, Buttons, StdCtrls, IniFiles;
@xjcl
xjcl / shitty_pong.py
Last active June 8, 2021 12:50
A simple pong game written in python and pyglet.
"""
Play a simple game of pong in a window.
Player 0 controls: (W, S) Player 1 controls: (O, L). Quit: (Q)
The ball bounces differently if you move while hitting it.
This also includes a slight factor of randomness.
Requires: pyglet, 10x10 image in directory: "white_square.png"
"""
@xjcl
xjcl / generate_cleansed.py
Last active August 29, 2015 14:05
Takes a short text quote and turns it into an inspirational image (text2quote). This gist includes a reddit bot (quotebot). License is GPL v3. Example: http://i.imgur.com/wEg3JsK.png
# WHAT?
# this is a modified version of tst's generate bot for
# text2quote (i.e. text on a fancy background) generation.
# it is stripped in that the imgur/reddit references are
# removed and it is called in the same way as my own text2quote
# module (so it is interchangable).
# UNTESTED AND HACKY, USE AT YOUR OWN RISK.
import os
import textwrap
@xjcl
xjcl / local_reddit.py
Created May 1, 2014 12:45
A python script that screencaps reddit comment threads. BECAUSE WHY READ A BOOK WHEN YOU'RE OFFLINE??
"""
USAGE:
You need xvfb, python(2), praw and CutyCapt (see below). Simply run this as
a normal python script: `python local_reddit.py`
CUSTOMIZATION:
* change number of screencaps in main() (10 by deafault)
* change queried subreddits in main()
(query multiple reddits: "askreddit+writingprompts")
* get_top() submissions from day/week instead of hot ones (get_hot())
TIME: