Skip to content

Instantly share code, notes, and snippets.

@dearprakash
dearprakash / 2025-02-06.md
Created February 6, 2025 22:11
2025-02-06.md
  • Take daily notes

  • Anything you learn during the day, note it

  • Log what was done

  • Start with goals for day

  • End the day with revising

gsadfsa
@dearprakash
dearprakash / stablediffusionwalk.py
Created November 29, 2023 20:37 — forked from karpathy/stablediffusionwalk.py
hacky stablediffusion code for generating videos
"""
stable diffusion dreaming
creates hypnotic moving videos by smoothly walking randomly through the sample space
example way to run this script:
$ python stablediffusionwalk.py --prompt "blueberry spaghetti" --name blueberry
to stitch together the images, e.g.:
$ ffmpeg -r 10 -f image2 -s 512x512 -i blueberry/frame%06d.jpg -vcodec libx264 -crf 10 -pix_fmt yuv420p blueberry.mp4
@dearprakash
dearprakash / gist:d4967d396d59d3eeb3e012b91b25baa9
Created January 22, 2022 05:54
Makefile for creating .dat files for fortune
# This will look at any file in that directory that isn't named "README", "Makefile", or that doesn't already end with ".dat". It will then run strfile on them, resulting in correspondingly named datfiles.
POSSIBLE += $(shell ls -1 | egrep -v '\.dat|README|Makefile' | sed -e 's/$$/.dat/g')
all: ${POSSIBLE}
%.dat : %
@strfile $< $@
@dearprakash
dearprakash / VCSEC.proto
Created January 19, 2022 18:10 — forked from LexNastin/VCSEC.proto
The Tesla "Vehicle Secondary" protocol buffer, used for communication with phone keys, keyfobs, tire pressure sensors, and possibly more. Belongs to Tesla, I just extracted it from their mobile app.
/*
* ___________________________________________________________
* | Made by Tesla Motors |
* | Pulled by Arch from the Android app, version: 3.10.13-469 |
* |___________________________________________________________|
*/
syntax = "proto3";
package VCSEC;
function dpurgeall(){
docker rm -v $(docker ps -a -q -f status=exited);
docker volume rm $(docker volume ls -qf dangling=true);
docker image rm $(docker images -qf dangling=true);
}
@dearprakash
dearprakash / gist:12a6195aae4b36d9fbfa97c82d3825ae
Created April 10, 2018 14:01
Resolve issue with multiple rbenv
sudo xcode-select --install
Install rbenv with brew install rbenv
Add eval "$(rbenv init -)" to the end of ~/.zshrc or ~/.bash_profile
Install a ruby version rbenv install 2.3.0
Select a ruby version by rbenv rbenv global 2.3.0
Open a new terminal window
Verify that the right gem folder is being used with gem env home (should report something in your user folder not system wide)
class Dynamic<T> {
typealias Listener = T -> Void
var listener: Listener?
func bindAndFire(listener: Listener?) {
self.listener = listener
listener?(value)
}
var value: T {
@dearprakash
dearprakash / gist:9d4707f99d210a5afdd3
Created April 14, 2015 12:22
Search for xib files recursively
find . -type f -name "*.xib"
if([String rangeOfString:@"substring"].location != NSNotFound)
{
// Has substring.. do whatever..
}