Skip to content

Instantly share code, notes, and snippets.

@rms1000watt
rms1000watt / python-printJS-in-pdf.py
Last active March 29, 2024 11:24
Python script to add JS to pdf so the pdf will print immediately when opened
# IE users need: https://get.adobe.com/reader/
from PyPDF2 import PdfFileWriter, PdfFileReader
output = PdfFileWriter()
ipdf = PdfFileReader(open('old.pdf', 'rb'))
for i in xrange(ipdf.getNumPages()):
page = ipdf.getPage(i)
output.addPage(page)
@Kartones
Kartones / postgres-cheatsheet.md
Last active March 29, 2024 11:23
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)
@SoabY
SoabY / JetBrains products Activation code until 15 May 2024
Created October 1, 2023 08:04
JetBrains products Activation code until 15 May 2024
8Z6IT0PIZH-eyJsaWNlbnNlSWQiOiI4WjZJVDBQSVpIIiwibGljZW5zZWVOYW1lIjoiSHVuYW4gTm9ybWFsIFVuaXZlcnNpdHkiLCJhc3NpZ25lZU5hbWUiOiJTdGFyayB6aGFuZyIsImFzc2lnbmVlRW1haWwiOiJzdGFyazE5ODUyMDIwQGdtYWlsLmNvbSIsImxpY2Vuc2VSZXN0cmljdGlvbiI6IkZvciBlZHVjYXRpb25hbCB1c2Ugb25seSIsImNoZWNrQ29uY3VycmVudFVzZSI6ZmFsc2UsInByb2R1Y3RzIjpbeyJjb2RlIjoiRFBOIiwicGFpZFVwVG8iOiIyMDI0LTA1LTE1IiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJEQiIsInBhaWRVcFRvIjoiMjAyNC0wNS0xNSIsImV4dGVuZGVkIjpmYWxzZX0seyJjb2RlIjoiUFMiLCJwYWlkVXBUbyI6IjIwMjQtMDUtMTUiLCJleHRlbmRlZCI6ZmFsc2V9LHsiY29kZSI6IklJIiwicGFpZFVwVG8iOiIyMDI0LTA1LTE1IiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJSU0MiLCJwYWlkVXBUbyI6IjIwMjQtMDUtMTUiLCJleHRlbmRlZCI6dHJ1ZX0seyJjb2RlIjoiR08iLCJwYWlkVXBUbyI6IjIwMjQtMDUtMTUiLCJleHRlbmRlZCI6ZmFsc2V9LHsiY29kZSI6IkRNIiwicGFpZFVwVG8iOiIyMDI0LTA1LTE1IiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJSU0YiLCJwYWlkVXBUbyI6IjIwMjQtMDUtMTUiLCJleHRlbmRlZCI6dHJ1ZX0seyJjb2RlIjoiRFMiLCJwYWlkVXBUbyI6IjIwMjQtMDUtMTUiLCJleHRlbmRlZCI6ZmFsc2V9LHsiY29kZSI6IlBDIiwicGFpZFVwVG8iOiIyMDI0LTA1LTE1IiwiZ
@ajtazer
ajtazer / P4r411315 8U51N355 4C71V4710N K3Y.txt
Created January 3, 2022 14:17
Parallels Business Activation Key
Parallels Business Activation Key
6YDASE-890T7S-E5YFS6-54F6YW-4780JY
390349-032409-342340-932902-390693
@bdcravens
bdcravens / add-timestamps.sql
Created December 19, 2012 21:32
SQL Server - add createdAt and updatedAt columns, automatically updates
ALTER TABLE myTable
add createdAt datetime
CONSTRAINT DF_myTable_createdat DEFAULT GETDATE()
ALTER TABLE myTable
add updatedAt datetime
CONSTRAINT DF_myTable_updatedAt DEFAULT GETDATE()
go
@terickson001
terickson001 / main.odin
Last active March 29, 2024 11:16
vulkan-tutorial example in Odin
import "shared:shaderc"
import "vendor:glfw"
import vk "vendor:vulkan"
MAX_FRAMES_IN_FLIGHT :: 2
Context :: struct
{
instance: vk.Instance,
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active March 29, 2024 11:15 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@OrionReed
OrionReed / DOM3D.js
Last active March 29, 2024 11:12
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯