Skip to content

Instantly share code, notes, and snippets.

@ssokolow
ssokolow / pagination_example.sql
Created December 23, 2009 13:02
Reasonably efficient pagination without OFFSET (SQLite version)
-- Reasonably efficient pagination without OFFSET
-- SQLite version (Adapted from MS SQL syntax)
-- Source: http://www.phpbuilder.com/board/showpost.php?p=10376515&postcount=6
SELECT foo, bar, baz, quux FROM table
WHERE oid NOT IN ( SELECT oid FROM table
ORDER BY title ASC LIMIT 50 )
ORDER BY title ASC LIMIT 10

Feedback for Juniors

I'm currently reviewing applications for a junior front-end position I advertised recently.

For those that applied, it's going to take a while to get back to you. I've gotten about 300 applications. However, I think it would be useful to share some general feedback based on the applications I've received thus far. The goal here is honesty, so I hope it doesn't come across as harsh, but instead as a useful perspective from the other side of the hiring table.

🔥 The tech hiring space is a dumpster-fire at the moment. We need to start with the acknowledgment. It is not that you are not good enough, or doing something wrong. The market is over-saturated with junior applicants. According to Offerzen applications rose by 300% in only 12 months.

@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active April 18, 2024 11:30
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@Chengings
Chengings / .editorconfig
Last active April 18, 2024 11:30
Cheatsheets
trim_trailing_whitespace = true
@anthonyjoeseph
anthonyjoeseph / fireblocksCosmos.ts
Last active April 18, 2024 11:28
RAW signing via fireblocks API
import path from "path";
import fs from "fs";
import { coins, pubkeyToAddress } from "@cosmjs/amino";
import { fromHex, toBase64, toHex } from "@cosmjs/encoding";
import { StargateClient } from "@cosmjs/stargate";
import { encodePubkey, makeSignBytes } from "@cosmjs/proto-signing";
import { EncodeObject, Registry, makeAuthInfoBytes, makeSignDoc } from "@cosmjs/proto-signing";
import { sha256 } from "@cosmjs/crypto";
import { FireblocksSDK, TransactionOperation, TransactionStatus } from "fireblocks-sdk";
import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";
@rafaelp
rafaelp / find_unused_images.rake
Last active April 18, 2024 11:27
Rake task to find unused images on Rails project to deletion.
# It requires ACK - http://betterthangrep.com/
task :find_unused_images do
images = Dir.glob('app/assets/images/**/*')
images_to_delete = []
images.each do |image|
unless File.directory?(image)
# print "\nChecking #{image}..."
print "."
result = `ack -1 -G '(app|public)' --ruby --html --css --js #{File.basename(image)}`
@liviaerxin
liviaerxin / README.md
Last active April 18, 2024 11:26
FastAPI and Uvicorn Logging #python #fastapi #uvicorn #logging

FastAPI and Uvicorn Logging

When running FastAPI app, all the logs in console are from Uvicorn and they do not have timestamp and other useful information. As Uvicorn applies python logging module, we can override Uvicorn logging formatter by applying a new logging configuration.

Meanwhile, it's able to unify the your endpoints logging with the Uvicorn logging by configuring all of them in the config file log_conf.yaml.

Before overriding:

uvicorn main:app --reload
@Athou
Athou / docker-wsl2-setup.sh
Last active April 18, 2024 11:23
install docker in Debian 11/WSL2 without Docker Desktop
# install docker in Debian 11/WSL2
# uses systemd-genie since docker requires systemd but it's not available for WSL
# this is an alternative to Docker Desktop
# prerequisites
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install ca-certificates curl wget gnupg lsb-release apt-transport-https
# systemd-genie requires dotnet runtime, add Microsoft repo
@SwitHak
SwitHak / 20211210-TLP-WHITE_LOG4J.md
Last active April 18, 2024 11:20
BlueTeam CheatSheet * Log4Shell* | Last updated: 2021-12-20 2238 UTC

Security Advisories / Bulletins / vendors Responses linked to Log4Shell (CVE-2021-44228)

Errors, typos, something to say ?

  • If you want to add a link, comment or send it to me
  • Feel free to report any mistake directly below in the comment or in DM on Twitter @SwitHak

Other great resources

  • Royce Williams list sorted by vendors responses Royce List
  • Very detailed list NCSC-NL
  • The list maintained by U.S. Cybersecurity and Infrastructure Security Agency: CISA List
@alanwei43
alanwei43 / windows-port-proxy.md
Last active April 18, 2024 11:19
windows powershell port forward
netsh interface portproxy add v4tov4 protocol=tcp connectaddress=192.168.67.128 connectport=9091 listenport=9091