Skip to content

Instantly share code, notes, and snippets.

@Kartones
Kartones / postgres-cheatsheet.md
Last active May 7, 2024 17:48
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)
@CurtisL
CurtisL / .htaccess
Last active May 7, 2024 17:47
Better Maintenance Mode .htaccess rules
# BEGIN MAINTENANCE MODE
# ADD your IP address to gain access. Local IPS for local testing
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^192\.168\.0\.0
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1
RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
RewriteCond %{DOCUMENT_ROOT}/maintenance.enable -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /maintenance.html [R=503,L]
@jxson
jxson / README.md
Created February 10, 2012 00:18
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

@LukeZGD
LukeZGD / ios-downgrade-dualboot.md
Last active May 7, 2024 17:41
Downgrade and dualboot status of almost all iOS devices

Downgrade and dualboot status of almost all iOS devices

UPDATED: 2024-05-02

@ifiokjr
ifiokjr / ADB Instructions.md
Last active May 7, 2024 17:41
Android Platform Tools
@geekman
geekman / myusbgadget
Created January 17, 2017 02:47
Pi Zero multiple USB gadgets minimal example
#!/bin/bash -e
modprobe libcomposite
cd /sys/kernel/config/usb_gadget/
mkdir g && cd g
echo 0x1d6b > idVendor # Linux Foundation
echo 0x0104 > idProduct # Multifunction Composite Gadget
echo 0x0100 > bcdDevice # v1.0.0
@ruario
ruario / authy-fetch-extract-snap.md
Last active May 7, 2024 17:38
How to download and install Twilio Authy on a desktop Linux system without snap support
  • Make an install directory somewhere convenient and switch to it
mkdir -p ~/.local/share/authy
cd ~/.local/share/authy
  • Fetch the current Authy snap
@diego3g
diego3g / settings.json
Last active May 7, 2024 17:38
VSCode Settings (Updated)
{
"workbench.startupEditor": "newUntitledFile",
"editor.fontSize": 14,
"editor.lineHeight": 1.8,
"javascript.suggest.autoImports": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"editor.rulers": [80, 120],
"extensions.ignoreRecommendations": true,
"typescript.tsserver.log": "off",
"files.associations": {
@cjfswd
cjfswd / api_discord_get_channel_messages.js
Last active May 7, 2024 17:38
discord rest api get all messages from channel
import fs from 'fs'
import fetch from 'cross-fetch';
import dotenv from 'dotenv';
dotenv.config();
const TOKEN = process.env.TOKEN || ''
const GUILD_URL = process.env.GUILD_URL || ''
class IGuild {