Skip to content

Instantly share code, notes, and snippets.

@NilsBaumgartner1994
NilsBaumgartner1994 / index.js
Last active December 19, 2022 22:43
An endpoint for directus to redirect to an application with providing the access_token
/**
https://gist.github.com/NilsBaumgartner1994/6e1a764491c736d7f187017c9e1f17cc
Place this file into: extensions/endpoints/redirect-with-token/
For example: https://<PUBLIC_URL>/api/auth/login/<AUTH_PROVIDER>?redirect=https://<PUBLIC_URL>/api/redirect-with-token?redirect=http://localhost?access_token=
This will get the access_token and will redirect the user to:
http://localhost?access_token=XXXXXXXXX
*/
@lnmunhoz
lnmunhoz / refactor-apollo-query-components-data-prop.js
Last active May 2, 2020 22:33
Fix Apollo Query components expecting the data prop to be an empty object
/**
* This transformer adds an empty object assignment to every Query component in the codebase.
* It will only touch the file if it find a Query that has object destructuring assignment.
* https://astexplorer.net/#/gist/a52e94d33bf5329027fddc77b95d9fe5/7b18cb8ae69e0ab4413375276863632cf6307d52
*/
export default function transformer(file, api) {
const j = api.jscodeshift
return j(file.source)
.find(j.JSXElement, path => path.openingElement.name.name === 'Query')
@mareks77
mareks77 / 001-Tradingview-Watchlist.md
Last active May 5, 2024 10:18 — forked from cryppadotta/001-Tradingview-Watchlist.md
Tradingview Watchlist Import Files for Crypto Exchanges

Tradingview Watchlist Import Files for Binance

The files below can be imported into a Tradingview watchlist.

Tradingview Watchlists

List is sorted by volume

@martinruenz
martinruenz / ffmpeg-snippets.md
Last active November 15, 2022 06:39
ffmpeg snippets / cheatsheet
@jbboehr
jbboehr / ffmpeg-hevc-encode-nvenc.md
Created February 23, 2017 21:58
This gist shows you how to encode specifically to HEVC with ffmpeg's NVENC on supported hardware, with a two-pass profile and optional CUVID-based hardware-accelerated decoding.

Encoding high-quality HEVC content in a two-pass manner with FFmpeg - based NVENC encoder on supported hardware:

If you've built ffmpeg as instructed here on Linux and the ffmpeg binary is in your path, you can do fast HEVC encodes as shown below, using NVIDIA's NPP's libraries to vastly speed up the process.

Now, to do a simple NVENC encode in 1080p, (that will even work for Maxwell Gen 2 (GM200x) series), start with:

ffmpeg  -i <inputfile> -pass 1 \
-filter:v hwupload_cuda,scale_npp=w=1920:h=1080:format=nv12:interp_algo=lanczos,hwdownload,format=nv12 \

-c:v hevc_nvenc -profile main -preset slow -rc vbr_2pass \

@tayvano
tayvano / gist:6e2d456a9897f55025e25035478a3a50
Created February 19, 2017 05:29
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@akirattii
akirattii / background.js
Created December 2, 2016 03:45
Message passing of Chrome Extension example
/*****************************************************************
* onMessage from the extension or tab (a content script)
*****************************************************************/
chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {
if (request.cmd == "any command") {
sendResponse({ result: "any response from background" });
} else {
sendResponse({ result: "error", message: `Invalid 'cmd'` });
}
@pathikrit
pathikrit / README.md
Last active April 24, 2021 17:36
My highly opinionated list of things needed to build an app in Scala
@atoponce
atoponce / gist:07d8d4c833873be2f68c34f9afc5a78a
Last active March 19, 2024 17:24 — forked from tqbf/gist:be58d2d39690c3b366ad
Cryptographic Best Practices

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm