Skip to content

Instantly share code, notes, and snippets.

@foosel
foosel / stl_to_svg.scad
Created December 7, 2021 13:59
STL to SVG conversion script using OpenSCAD. Takes an STL and projects it to the defined plane (default: XY), then saves the result as SVG.
FileToLoad = "";
Plane=0; // 0: XY, 1: XZ, 2: YZ
echo("File:", FileToLoad);
projection() {
if (Plane == 0) {
echo("Plane: XY");
import(FileToLoad);
} else if (Plane == 1) {
echo("Plane: XZ");
#/bin/bash
#
# https://twitter.com/samykamkar/status/1011166802880020482
# Sniff network traffic from your iOS device, no jailbreak necessary! Just plug into your mac and run:
system_profiler SPUSBDataType|perl -0 -ne'/iP(?:hone|ad):.*?Serial Number: (\S+)/s?`rvictl -s $1`:0' ; sudo tcpdump -i rvi0 # standard tcpdump options/filters apply
@wesbos
wesbos / gist:d7877929def4368cdb8abc12c5d3e38b
Last active September 9, 2020 15:21
"Out Of Office" Filter
Trying to filter "out of office" emails from my inbox as I receive a lot of them when I send a blast.
I need help - what do your "out of office" emails say in your langauge? Comment Below!
## Gmail Filter
("Automatische Antwort" OR "Automatic reply" OR "AutoReply" OR "Out of Office" OR "Xesc Duran" OR "Abwesend" OR "Absence" OR "Absence du bureau" OR "À l'extérieur du bureau" OR "Réponse automatique" OR "Abwesenheitsnotiz" OR "Resposta automática" OR "Automaattinen vastaus" OR "Automatisch antwoord" OR "Afwezig" OR "Afwezigheid" OR "Niet aanwezig" OR "Poza zasięgiem" OR "Na wakacjach" OR "Poza biurem" OR "Automatyczna odpowiedź" OR "Z dala od komputera" OR "Αυτόματη απάντηση" OR "Εκτός γραφείου" OR "na dovolenké" OR "mimo kancelárie" OR "automatická odpověď" OR "Autosvar" OR "Fora do escritório" OR "na dovolené" OR "mimo kancelář")
## List
Automatische Antwort
Automatic reply
@stevenharman
stevenharman / postgres_open_connections.sql
Last active April 3, 2018 17:23
View open connections to a PostgreSQL 9.2+ database. Quite useful when you're seeing ActiveRecord::ConnectionTimeoutError on Heroku.
-- On Heroku:
-- $ heroku pg:psql
-- An explaination of the columns on the pg_stat_activity table:
-- http://www.postgresql.org/docs/9.2/static/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW
select
pid, application_name, query, waiting, state, state_change
from pg_stat_activity
where usename = current_user
order by state_change desc;
@NelsonMinar
NelsonMinar / google.ahk
Created December 11, 2010 17:15
AutoHotkey script to make CapsLock open URLs and search Google
; AutoHotkey script to make CapsLock open URLs and search Google with Clipboard contents.
; By Nelson Minar <nelson@monkey.org> Inspired by code at http://www.autohotkey.com/forum/topic14656.html
CapsLock::
url := RegExReplace(Clipboard, "^\s+|\s+$") ; Trim whitespace
if RegExMatch(url, "^(http|ftp|telnet)") {
; Do nothing if it already looks like a URL
} else {
; Escape the query string. Could escape more, but this seems sufficient for Chrome
StringReplace, url, url, `%, `%25, All