Skip to content

Instantly share code, notes, and snippets.

@jacksonhenry3
jacksonhenry3 / index.html
Created July 10, 2012 20:33
lissajous figure plotter
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
.axis path, .axis line {
fill: none;
@gelisam
gelisam / Main.hs
Last active December 13, 2022 02:56
write a Gloss Picture to a file or an animation to a series of files
-- in response to https://www.reddit.com/r/haskell/comments/3u5s4e/is_there_a_way_to_write_the_frames_of_a_gloss/
import Codec.Picture.Types (Image(..), PixelRGBA8)
import Codec.Picture.Png (writePng)
import Control.Monad (forM_)
import Data.Vector.Storable (Vector, unsafeFromForeignPtr0)
import qualified Graphics.Gloss as Gloss
import qualified Graphics.Gloss.Rendering as Gloss
import Graphics.Rendering.OpenGL.Raw -- as gl*
import qualified Graphics.UI.GLFW as GLFW
@tylerneylon
tylerneylon / .block
Last active May 3, 2024 01:21
Quick js code to draw math functions in an SVG element.
license: mit
@DavidWells
DavidWells / aligning-images.md
Last active November 14, 2024 03:45
Guide to aligning images in github readme.md files. https://davidwells.io/snippets/how-to-align-images-in-markdown

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

@evertrol
evertrol / Makefiles.md
Last active November 15, 2024 12:05
Makefile cheat sheet

Makefile cheat sheet

Mostly geared towards GNU make

I've used ->| to indicate a tab character, as it's clearer to read than

  • Set a target, its dependencies and the commands to execute in order
target: [dependencies]
-&gt;| 
@navenduagarwal
navenduagarwal / dummyimage.py
Created June 14, 2018 06:09
python script to create dummy image via opencv
import cv2
import numpy as np
def create_blank(width, height, rgb_color=(0, 0, 0)):
"""Create new image(numpy array) filled with certain color in RGB"""
# Create black blank image
image = np.zeros((height, width, 3), np.uint8)
# Since OpenCV uses BGR, convert the color first
@geberl
geberl / radar_chart.py
Created September 21, 2018 09:58
A 12-axis radar chart in Python (conda/miniconda) via numpy/pandas/matplotlib
#!/usr/bin/python
"""
Installation: Get the *Miniconda* Python Distribution - not the Python distrubution from python.org!
- https://conda.io/miniconda.html
Then install modules:
- `cd ~/miniconda3/bin`
- `./conda install numpy pandas matplotlib`
@cosven
cosven / mpv_qtwidget_opengl.py
Last active December 15, 2021 23:16
mpvwidget implemented with PyQt5 and QOpenGLWidget (currently used in http://github.com/cosven/feeluown)
# BSD 3-Clause License
#
# Copyright (c) 2020, Cosven
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
from tkinter import *
from PIL import ImageTk,Image
import time
import os
targetImageWidth = 850
targetImageHeight = 400
inputImageWidth = 0
inputImageHeight = 0
@katef
katef / life-utf8.c
Last active September 8, 2024 05:59
XBM to UTF-8 braille image things
/*
* John Conway's Game of Life.
*
* This is written for POSIX, using Curses. Resizing of the terminal is not
* supported.
*
* By convention in this program, x is the horizontal coordinate and y is
* vertical. There correspond to the width and height respectively.
* The current generation number is illustrated when show_generation is set.
*