Skip to content

Instantly share code, notes, and snippets.

@april
april / find-all-electron-versions.sh
Last active March 15, 2024 00:56
find all apps using Electron and their versions, on macOS systems
#!/usr/bin/env zsh
# patched versions for CVE-2023-4863: 22.3.24, 24.8.3, 25.8.1, 26.2.1
mdfind "kind:app" 2>/dev/null | sort -u | while read app;
do
filename="$app/Contents/Frameworks/Electron Framework.framework/Electron Framework"
if [[ -f $filename ]]; then
echo "App Name: $(basename ${app})"
electronVersion=$(strings "$filename" | grep "Chrome/" | grep -i Electron | grep -v '%s' | sort -u | cut -f 3 -d '/')
@llimllib
llimllib / install.sh
Last active April 11, 2024 21:07
The script I use to set up a new mac just the way I like it
#!/usr/bin/env bash
# many settings from https://raw.githubusercontent.com/mathiasbynens/dotfiles/master/.macos
# many settings from https://raw.githubusercontent.com/thoughtbot/laptop/master/mac
# instructions on finding the default you've changed: https://pawelgrzybek.com/change-macos-user-preferences-via-command-line/
# previous install notes at:
# https://gist.github.com/llimllib/ee591266e05bd880629a4e7511a61bb3
# https://gist.github.com/llimllib/e864a92da94ceb1ef0da2e06fd1f8d70
# https://gist.github.com/llimllib/3fc4fefcfc0152dad8c58201246d8802
#
# this script's URL is: https://gist.github.com/llimllib/c4dd0a98a426022b0365d4c0a9090460
@RobertAKARobin
RobertAKARobin / safari.md
Last active January 5, 2024 05:41
Safari's date-picker is the cause of 1/3 of our customer support issues

Safari's date-picker is the cause of 1/3 of our customer support issues

...and obviously we're building a workaround. But I'm absolutely flabbergasted that a standard <input type="date"> HTML field, in a standard browser, from a company that bases its reputation good design, could be so dreadful.

The context

I'm the developer for a startup that sells a genetic test to recommend medications for high blood pressure. For medical reasons we need to know our customers' birth date. Most of our customers are in their 60s or older. We've found that many of them use iPads or iPhones. And they're the ones who complain to our customer support that our site is unusable.

The problem

<?php
/**
* DataGrab File Grid fieldtype class
*
* @package DataGrab
* @author Andrew Weaver <aweaver@brandnewbox.co.uk>
* @copyright Copyright (c) Andrew Weaver
*/
class Datagrab_file_grid extends Datagrab_fieldtype
@thealanberman
thealanberman / mac_recommendations.md
Last active August 8, 2023 16:25
My Mac Recommendations

macOS Recommendations

General Utilities

  • Rectangle — a free option for window snapping/arrangement stuff.
  • AltTab — an improved window switcher with some decent customizability
  • Shifty — a macOS "night shift" slider
  • Raycast — Spotlight replacement, somewhat like Alfred, but free and more customizable
  • Better Touch Tool — not free, but worth every penny. Pretty awesome window snapping/arrangement capabilties (like Rectangle but MOAR), and lets you create shortcuts for keyboard/mouse/touchpad/touchbar/etc.
  • Keka — compression utility that handles 7zip, rar, and some other archive formats that don't work natively in macOS.
  • NameChanger — batch file-renamer with a handy intuitive UI
@tomhicks
tomhicks / plink-plonk.js
Last active March 18, 2024 02:23
Listen to your web pages
Apache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/system [NC]
RewriteCond %{QUERY_STRING} !ACT|URL [NC]
RewriteCond %{REQUEST_METHOD} !=POST [NC]
RewriteCond $1 !\.(css|js|gif|jpe?g|png) [NC]
RewriteCond %{DOCUMENT_ROOT}/static/default_site/static%{REQUEST_URI}/index\.php -f
RewriteRule ^ /static/default_site/static%{REQUEST_URI}/index\.php [L,QSA]
@sveggiani
sveggiani / instructions.md
Last active July 15, 2023 21:52
[Configure XDebug, Visual Studio Code for a Vagrant VM] #debug #vm #vscode #masscode

Configure XDebug, Visual Studio Code for a Vagrant VM

1. Assumptions

  • Project (Drupal) is served on /var/www/html in the Vagrant box
  • Local project files location: c:\Users\username\Work\projects\my-project\repo\html
  • Guest machine IP is 10.0.2.2 (if this doesn't work, run route -nee in the VM and look for the gateway address)

2. Configuration

@leevigraham
leevigraham / Generate ssl certificates with Subject Alt Names on OSX.md
Last active January 31, 2023 19:54
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

We're going to generate a key per project which includes multiple fully qualified domains. This key can be checked into the project repo as it's intended for local development but never used on production servers.

Save ssl.conf to your my_project directory.

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

@pedro-santiago
pedro-santiago / migrate.sh
Last active November 18, 2020 22:20 — forked from gghughunishvili/migrate1.sh
Upgrade MAMP 4 to Mysql 5.7.18 (on Sierra tested)
#!/bin/sh
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.18-macos10.12-x86_64.tar.gz
tar xfvz mysql-5.7.18-macos10.12-x86_64.tar.gz
echo "Stopping MAMP"
sudo /Applications/MAMP/bin/stop.sh
sudo killall httpd mysqld
echo "Copy Bin"