Skip to content

Instantly share code, notes, and snippets.

View gregorym's full-sized avatar
🏠
Working from home

Gregory Marcilhacy gregorym

🏠
Working from home
View GitHub Profile
<svg width="300" height="300" viewBox="0 0 300 300">
<defs>
<filter id="paperEffect">
<feTurbulence
type="fractalNoise"
baseFrequency="0.04"
numOctaves="5"
result="noise"
/>
<feDiffuseLighting
@audioscavenger
audioscavenger / api_comfyui-img2img.py
Last active February 29, 2024 15:51
ComfyUI for stable diffusion: API call script to run automated workflows
# https://gist.github.com/audioscavenger/0471b389b88ce3a3998d510832affed9
# 1. install ComfyUI-Custom-Scripts: cd E:\GPT\ComfyUI\custom_nodes\ && git clone https://github.com/pythongosssss/ComfyUI-Custom-Scripts
# 2. enable dev mode options
# 3. save workflow in API format
# 4. python api_comfyui-img2img.py -w E:\GPT\ComfyUI\output\ComfyUI-workflow-recolor-api.json -i E:\GPT\ComfyUI\output\image-grey.jpg -o outputPrefix
# NOTE: Saving image outside the output folder is not allowed.
import getopt, sys, os
import json, urllib, random
from urllib import request, parse
@rabssm
rabssm / ffmpegtips.txt
Last active March 2, 2025 09:37
ffmpeg tips
# Interpolate video frames for a higher frame rate
ffmpeg -i source.mp4 -filter:v minterpolate -r 25 result.mp4
ffmpeg -i source.mp4 -vf minterpolate=50,tblend=all_mode=average,framestep=2 result.mp4
# Change the framerate (to 5 fps) of an input h264 raw video and convert to mkv
ffmpeg -r 5 -i input.h264 -vcodec copy output.mkv
# Crop a video to the bottom right quarter
ffmpeg -i in.mp4 -filter:v "crop=in_w/2:in_h/2:in_w/2:in_h/2" -c:a copy out.mp4
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active March 24, 2025 20:20
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

.
├── actions
├── stores
├── views
│   ├── Anonymous
│   │   ├── __tests__
│   │   ├── views
│   │   │   ├── Home
│   │   │   │   ├── __tests__
│   │   │   │   └── Handler.js
@staltz
staltz / introrx.md
Last active April 24, 2025 06:10
The introduction to Reactive Programming you've been missing
@willurd
willurd / web-servers.md
Last active April 20, 2025 00:42
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@pklaus
pklaus / mkvideo.sh
Last active December 23, 2019 09:51
A Bash script to create a video from series of JPEG images. Ideal to create videos from timed sequences shot with a tripod. It uses mogrify (from imagemagick) to resize the images to FullHD and it then uses ffmpeg to create a video from the sequence of images.
#!/bin/bash
# This is a script to create a video from series of JPEG images
# Call it in a folder full of JPEGs that you want to turn into a video.
# Written on 2013-01-08 by Philipp Klaus <philipp.l.klaus →AT→ web.de>.
# Check <https://gist.github.com/4572552> for newer versions.
# Resources
# * http://www.itforeveryone.co.uk/image-to-video.html
# * http://spielwiese.la-evento.com/hokuspokus/index.html
@trcarden
trcarden / gist:3295935
Created August 8, 2012 15:28
Rails 3.2.7 SSL Localhost (no red warnings, no apache config)
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key