View chatgpt_typing_analyser.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import termios | |
import time | |
import tty | |
import random | |
def read_char(): | |
fd = sys.stdin.fileno() | |
old_settings = termios.tcgetattr(fd) |
View permutations.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View involute.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Base.Iterators | |
RIGHT = (0, 1) | |
DOWN = (1, 0) | |
LEFT = (0, -1) | |
UP = (-1, 0) | |
function involute(n::Int)::Matrix{Int} | |
directions = cycle((RIGHT, DOWN, LEFT, UP)) | |
repeats = pushfirst!(collect(flatten(zip(n-1:-1:1, n-1:-1:1))), n-1) |
View lilac_chaser.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Javis | |
video = Video(500, 500) | |
N = 12 | |
frames = 4(N+1) | |
Background(1:frames, (args...) -> background("grey70")) | |
# Draw crosshairs | |
Object(@JShape begin |
View circle_illusion_with_actions.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Animations | |
using ColorSchemes | |
using Javis | |
N = 6 # number of circles | |
radius = 20 # Radius of each circles | |
speed = 5 # degrees per frame | |
colors = ColorSchemes.rainbow1 | |
video = Video(500, 500) |
View circle_illusion.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ColorSchemes | |
using Javis | |
N = 6 # Number of dots | |
radius = 20 # Radius of each dot | |
colors = ColorSchemes.rainbow1 # Color palette | |
speed = 10 # Degrees per frame | |
function draw_circle(frame, i, radius, speed) | |
# Angle of the direction vector for the dot |
View circles.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Javis | |
using ColorSchemes | |
# Set the color scheme | |
# More options: | |
# https://juliagraphics.github.io/ColorSchemes.jl/stable/catalogue/ | |
colors = ColorSchemes.cool | |
function circ(radius, color="white") | |
sethue(color) # Set the color of the circle |
View musical_graphs.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import LinearAlgebra as LinAlg | |
import SparseArrays | |
import Graphs | |
import GraphRecipes: graphplot | |
import Plots: savefig | |
import WAV | |
function normalized_laplacian_matrix(g::Graphs.SimpleGraph) |
View graph_music.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import LinearAlgebra as LinAlg | |
import SparseArrays | |
import Graphs | |
import WAV | |
function normalized_laplacian_matrix(g::Graphs.SimpleGraph) | |
A = Graphs.CombinatorialAdjacency(Graphs.adjacency_matrix(g).+ 0.0) | |
 = Graphs.NormalizedAdjacency(A) |
View shuffle.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools as it | |
import random | |
import timeit | |
def shuffle(deck): | |
"""Return iterator over shuffled deck.""" | |
deck = list(deck) | |
random.shuffle(deck) | |
return iter(tuple(deck)) |
NewerOlder