Skip to content

Instantly share code, notes, and snippets.

View zeddee's full-sized avatar

Zed zeddee

View GitHub Profile
@zeddee
zeddee / post-vs-get.md
Last active August 7, 2019 11:00
POST requests more secure than GET requests?
  • Was inspecting a REST API reference, and found that all requests are POST requests.
  • Reason given was that POST requests are more secure than GET requests, presumably because you don't send data in the URL query
  • But...insufficient reason?
  • API key is sent in header.
  • Otherwise no difference in the interface; comes down to how the REST API server resolves the request.
  • POST requests are usually used to create resources.
  • So having all REST endpoints as POST endpoints is weird because

General Notes on C

Notes in an attempt to document a C library.

Pointers

You can write C pointers in the following ways:

  • someType* somePtr;

gcloud cheatsheet

Basic

Command Description
gcloud auth login log into google cloud console with credentials
gcloud config set project <PROJECT_ID> set project ID (local gcloud starts without a set active project)
gcloud beta interactive enters a very very awesome "interactive" mode with autocomplete and command preview.
gcloud config set compute/zone asia-southeast1-a sets compute zone to given zone id.

Svelte notes

Notes while going throught: https://svelte.dev/tutorial/

Personal thoughts:

  • pretty quick to get through
  • excited that it's a compiled language
  • types? compatible with typescript, since you also need to invoke it like the ts compiler?
#!/usr/bin/env sh
# This script:
# 1. Creates a new directory to store the reports we're going to generate.
# 2. Generate a lighthouse report for desktop emulation.
# 3. Generate a lighthouse report for mobile emulation, with basic 3G throttling settings taken from here: https://github.com/GoogleChrome/lighthouse/commit/a9b02a948b579be1a0667b69627f6d1f831d30ca
run() {
NOW=$(date +%Y-%m-%dT%H%M%S%z)
OUTPUT_FORMAT="html"

Using the doctl CLI tool

Install and use the doctl tool to manage Digital Ocean droplets.

Sample script to start up a DO droplet for running Lighthouse:

doctl compute droplet create lighthouse-runner \
  --size s-1vcpu-1gb \
  --region sgp1 \

(INCOMPLETE) Installing Wordpress + PHP-fpm from scratch on ubuntu

Install PHP

sudo apt-get install php-fpm # installs php7.2-fpm
sysctl status php7.2-fpm # checks status

Install NGINX to serve the PHP-fpm endpoint