Skip to content

Instantly share code, notes, and snippets.

View tgreiser's full-sized avatar

Tim Greiser tgreiser

View GitHub Profile
@tgreiser
tgreiser / colab_looping_video.py
Created December 10, 2022 01:37
Make a seamless looping video from a normal video (colab)
# assume you have out.mp4 that is a normal video
!ffmpeg -y -r 30 -i out.mp4 -vf reverse reversed.mp4
!ffmpeg -y -i out.mp4 -i reversed.mp4 -filter_complex "concat=n=2:v=1:a=0" output.mp4
print('\nSeamless loop (original saved to out.mp4):')
show_video('output.mp4')
@tgreiser
tgreiser / fa2_tezos_price_check.py
Last active January 30, 2022 21:59
Use pytezos to check the price of FA2 tokens at quipuswap
from pytezos import pytezos
pytezos = pytezos.using(shell='mainnet')
# Enter the tokens you are interested in from fa2_token_list.py
tokens = dict(
hDAO = ('KT1QxLqukyfohPV5kPkw97Rs6cw1DDDvYgbB', 6),
WRAP = ('KT1FG63hhFtMEEEtmBSX2vuFmP87t9E7Ab4t', 8),
bDAO = ('KT1DssMzoSr8fnUUq1WxeSuHfLG4gzS7pgge', 6),
STKR = ('KT1BMEEPX7MWzwwadW3NCSZe9XGmFJ7rs7Dr', 18),
@tgreiser
tgreiser / gist:f6b6d058e06db2f7d9d1982bbdf0a8af
Created November 30, 2018 17:03
Laser Games for Ether Dream
Laser Hexagon
https://github.com/tmplab/laser-hexagon
Laser Asteroids
https://github.com/tmplab/laser-asteroids
https://github.com/echelon/laser-asteroids
Laser Pong
https://github.com/tmplab/Laserpong
https://github.com/echelon/laser-pong
@tgreiser
tgreiser / ledPixelController_460.ino
Created February 19, 2018 03:32
Teensy LED controller using serial communication
// Lucas Morgan - www.enviral-design.com //
#define USE_OCTOWS2811
#include<OctoWS2811.h>
#include<FastLED.h>
// ------------ Change these as neccesary -----------//
#define NUM_LEDS_PER_STRIP 460
#define NUM_STRIPS 8
@tgreiser
tgreiser / paragraph_vector_example.scala
Created November 15, 2017 01:35
paragraph_vector_example.scala
/*
Ported from: https://github.com/deeplearning4j/dl4j-examples/blob/master/dl4j-examples/src/main/java/org/deeplearning4j/examples/nlp/paragraphvectors/ParagraphVectorsClassifierExample.java
NOTE - you must download the paravec resources data to /opt/data/paravec on your SKIL server.
https://github.com/deeplearning4j/dl4j-examples/tree/master/dl4j-examples/src/main/resources/paravec
*/
import scala.collection.JavaConversions._
import org.datavec.api.util.ClassPathResource;
import org.nd4j.linalg.primitives.Pair;
@tgreiser
tgreiser / notes.txt
Created October 23, 2016 16:19
Ether Dream in python
The canonical example is here:
https://github.com/j4cbo/j4cDAC/tree/master/tools/tester
a number of projects have been based off dac.py. Lots of them use pygame.
Most of the code only seems to run on python 2.7.
On windows, python 2.7 drops frames due to some buggy network packets.
@tgreiser
tgreiser / simple.go
Created September 21, 2016 19:21
Functional Dependency Injection example
package main
import "log"
// Our container
type Application struct {
DB Database
}
// Interface for a system component
/**
* This sample lets you record and share video with Appcelerator Titanium on Android.
* Tested on 3.2.1 of TITANIUM MOBILE SDK, should work on 3.x. I don't know about previous versions.
*
* Based on https://gist.github.com/dawsontoth/832488
* which does not fire the activity callback on 3.x
*/
/**
* First, create our UI. We'll have two buttons: record, and share.