Skip to content

Instantly share code, notes, and snippets.

@nfsarmento
nfsarmento / nginx-wordpress.conf
Last active April 30, 2024 19:49
Harden wordpress security nginx
############ WordPress ####################
# Disable logging for favicon and robots.txt
location = /favicon.ico {
try_files /favicon.ico @empty;
access_log off;
log_not_found off;
expires max;
}
/*
* spi_max7221.c
*
* Created: 7/14/2020 8:49:34 PM
* Author : https://aki-technical.blogspot.com
*/
#include <avr/io.h>
#define F_CPU 4000000UL
@Kartones
Kartones / postgres-cheatsheet.md
Last active April 30, 2024 19:47
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Z-Index Example</title>
<style>
html, body { background-color: #00787F; }
.container {
position: relative;
@Adjuvant
Adjuvant / VectorSwizzles.cs
Created April 21, 2019 14:10
Vector Swizzle Extensions
/*
* Vector Swizzle Extensions by Tyler Glaiel
* Version 1.0
* Sample Usage:
Vector2 a = new Vector2(1, 2);
Vector4 b = a.yxxy();
Debug.Log(b); //outputs (2.0, 1.0, 1.0, 2.0)
*/
using UnityEngine;
@edhowler
edhowler / https-redirect.config
Last active April 30, 2024 19:39
Elastic Beanstalk configuration to redirect HTTP to HTTPS (place this inside .ebextensions folder and deploy)
files:
/etc/nginx/conf.d/elasticbeanstalk/00_application2.conf:
owner: root
group: root
mode: "000644"
content: |
location / {
set $redirect 0;
if ($http_x_forwarded_proto != "https") {
set $redirect 1;
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 30, 2024 19:37
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Z-Index Example</title>
<style>
html, body { background-color: #00787F; }
.container {
position: relative;
@ZacSweers
ZacSweers / OkioAtomicFile.kt
Created September 16, 2018 06:02
Okio/AtomicFile interop kotlin extensions
import android.util.AtomicFile
import okio.Buffer
import okio.Sink
import okio.sink
import okio.source
import java.io.FileOutputStream
import java.io.IOException
fun AtomicFile.source() = openRead().source()
@JBlond
JBlond / bash-colors.md
Last active April 30, 2024 19:26 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple