Skip to content

Instantly share code, notes, and snippets.

@tannerlinsley
tannerlinsley / README.md
Created Jul 22, 2020
Why I still don't use GraphQL
View README.md

Some thoughts I've gathered over the years on what I think about GraphQL. All of this is subject to change of course, and some of it may be "hot-take"-ish, but at the end of the day, I've made decisions regarding GraphQL with my customers, users, and fellow developers in mind and with the mantra that if it ultimately doesn't make a big difference for any of those people and justify the work that it requires, it's not the best investment of time. It's more important to please your users, ship products in a timely manner, and use tools that keep processes simple and familiar.

  • A majority of the world still runs on REST and probably will for a while.
  • The challenges of larger companies that originally benefitted from GQL are not everyones challenges and they likely never will be.
  • I don't want to require my API users to have knowledge of GQL.
  • Strongly typed APIs are good, but I don't particularly enjoy the tools in the ecosystem right now to use them via GQL
  • GraphQL seems to have been born out of the req
View history.txt
I was drawn to programming, science, technology and science fiction
ever since I was a little kid. I can't say it's because I wanted to
make the world a better place. Not really. I was simply drawn to it
because I was drawn to it. Writing programs was fun. Figuring out how
nature works was fascinating. Science fiction felt like a grand
adventure.
Then I started a software company and poured every ounce of energy
into it. It failed. That hurt, but that part is ok. I made a lot of
mistakes and learned from them. This experience made me much, much
@xtavras
xtavras / kubernetes_add_service_account_kubeconfig.sh
Created Nov 25, 2019
create kubernetes service account and corresponding kubeconfig
View kubernetes_add_service_account_kubeconfig.sh
#!/usr/bin/env bash
# script was taken from https://gist.github.com/innovia/fbba8259042f71db98ea8d4ad19bd708 and adjusted with "apply_rbac" function and colorized output
set -e
set -o pipefail
# Colors
RED="\e[01;31m"
@karanlyons
karanlyons / ZoomDaemon.yara
Last active Jul 12, 2021
Fixes for Zoom, RingCentral, Zhumu (and additional white labels) RCE vulnerabilities
View ZoomDaemon.yara
private rule Macho
{
meta:
description = "private rule to match Mach-O binaries (copied from Apple's XProtect)"
condition:
uint32(0) == 0xfeedface or uint32(0) == 0xcefaedfe or uint32(0) == 0xfeedfacf or uint32(0) == 0xcffaedfe or uint32(0) == 0xcafebabe or uint32(0) == 0xbebafeca
}
rule ZoomDaemon
{
@sarthology
sarthology / regexCheatsheet.js
Created Jan 10, 2019
A regex cheatsheet 👩🏻‍💻 (by Catherine)
View regexCheatsheet.js
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active May 13, 2022
Stupid simple setting up WireGuard - Server and multiple peers
View WireGuard_Setup.txt
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
View index.js
#!/usr/bin/env node
const
express = require( 'express' ),
app = express(),
passport = require( 'passport' ),
LocalStrategy = require( 'passport-local' ).Strategy,
bodyParser = require( 'body-parser' );
app.use( bodyParser.urlencoded( { extended: true } ) );
@Firsh
Firsh / lwp-cloudflare-dyndns.sh
Last active May 8, 2022
Cloudflare as Dynamic DNS
View lwp-cloudflare-dyndns.sh
#!/bin/bash
# Cloudflare as Dynamic DNS
# From: https://letswp.io/cloudflare-as-dynamic-dns-raspberry-pi/
# Based on: https://gist.github.com/benkulbertis/fff10759c2391b6618dd/
# Original non-RPi article: https://phillymesh.net/2016/02/23/setting-up-dynamic-dns-for-your-registered-domain-through-cloudflare/
# Update these with real values
auth_email="email@example.com"
auth_key="global_api_key_goes_here"
zone_name="example.com"
@chrisstubbs93
chrisstubbs93 / ffmpeg.sh
Last active Apr 19, 2022
auto-restart FFMPEG when it stops sending frames to youtube
View ffmpeg.sh
#!/bin/sh
sleep 5
ffmpeg -re -f mjpeg -r 10 -i "http://localhost/?action=stream" -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -acodec aac -ab 1k -strict experimental -s 640x360 -vcodec h264 -pix_fmt yuv420p -g 20 -vb 500k -preset ultrafast -crf 31 -r 10 -f flv "rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx" 2> /home/pi/ffmpeg.log
@tdr2d
tdr2d / docker_cleanup.sh
Last active Mar 10, 2021
Remove all unused docker containers, remove all docker volumes, cleanup networks
View docker_cleanup.sh
#!/usr/bin/env bash
removevolumes() {
sudo docker volume rm $(sudo docker volume ls -qf dangling=true)
sudo docker volume ls -qf dangling=true | xargs -r sudo docker volume rm
}
removenetwork() {
sudo docker network ls
sudo docker network ls | grep "bridge"