Skip to content

Instantly share code, notes, and snippets.

View sp94's full-sized avatar

Samuel J Palmer sp94

  • London
View GitHub Profile
ffmpeg -filter_complex loop=loop=3:size=200:start=0 -framerate 50 -pattern_type glob -i 'f*.png' \
-c:v libx264 -crf 18 -r 50 -pix_fmt yuv420p output_insta.mp4
@sp94
sp94 / berry_curvature.jl
Created February 24, 2021 20:05
An example of calculating Berry curvature using wilson_eigen in Peacock v0.1.1
# An example of calculating Berry curvature using wilson_eigen in Peacock v0.1.1
# this will be wrapped into an easier to use function in Peacock v0.2
using Peacock, Peacock.Zoo, Parameters, PyPlot
# Load example crystal
@unpack solver, polarisation = make_wu_topo(7)
# In this example we will calculate the Berry curvature at Gamma
# so lets use a small(ish) Wilson loop around Gamma
# create high quality temporary GIF with imagemagick
# delay is duration of frame in 1/100ths of a second, ie "-delay 2" is 50 frames/second
convert -delay 2 -loop 0 f*.png temp.gif
# create a more reasonably sized output with gifsicle
# increase "--lossy=" to reduce file size
gifsicle --loop=0 --lossy=100 temp.gif -o output.gif
// Modified from @beesandbombs template
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
@sp94
sp94 / double_spiral.pde
Last active July 9, 2021 07:34
Processing3: Double Spiral
// Double Spiral
// https://twitter.com/sjpalmer1994/status/1337815101148164101
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}