Skip to content

Instantly share code, notes, and snippets.

tell application "System Events"
tell process "Firefox Nightly"
set tmp to value of attribute "AXEnhancedUserInterface"
set value of attribute "AXEnhancedUserInterface" to true
set returnUrl to value of attribute "AXValue" of text field 1 of combo box 1 of toolbar "Navigation" of UI element 1 of front window
set value of attribute "AXEnhancedUserInterface" to tmp
return returnUrl
end tell
end tell
@YKCzoli
YKCzoli / shapefileConversion.md
Last active January 14, 2025 13:41
Step through of converting shapefile to geojson with qgis.

Converting shapefiles to geojson

####Assumptions

Get the data

We will use the Electoral District and Polling Division shapefiles found on the Elections Ontario site:

@PhirePhly
PhirePhly / Makefile
Created June 12, 2012 03:12
A crazy simple SMTP server, for educational purposes only.
default:
cc ccsmtp.c -o ccsmtpd -lpthread
@joepie91
joepie91 / random.md
Last active January 14, 2025 13:39
Secure random values (in Node.js)

Not all random values are created equal - for security-related code, you need a specific kind of random value.

A summary of this article, if you don't want to read the entire thing:

  • Don't use Math.random(). There are extremely few cases where Math.random() is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case.
  • Don't use crypto.getRandomBytes directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable.
  • If you want to generate random tokens or API keys: Use uuid, specifically the uuid.v4() method. Avoid node-uuid - it's not the same package, and doesn't produce reliably secure random values.
  • If you want to generate random numbers in a range: Use random-number-csprng.

You should seriously consider reading the entire article, though - it's

@erezhod
erezhod / AsyncSVGImage.swift
Last active January 14, 2025 13:38
Async SVG image loading view for SwiftUI
//
// AsyncSVGImage.swift
// AsyncSVGImage
//
// Created by Erez Hod on 1/21/24.
//
import Darwin
import Foundation
import UIKit
@bradtraversy
bradtraversy / mysql_cheat_sheet.md
Last active January 14, 2025 13:37
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

import 'package:bloc/bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
void main() => runApp(BlocProvider<TestBloc>(
create: (c) => TestBloc(),
child: MyApp(),
));
class MyApp extends StatelessWidget {
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active January 14, 2025 13:36
Conventional Commits Cheatsheet

Conventional Commit Messages starline

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

@caruccio
caruccio / kubectl-setup.sh
Last active January 14, 2025 13:32
Setup basic kubectl bash env
# curl -sLO https://gist.github.com/caruccio/b9eb86e307ecc293d5b832af8c577605/raw/kubectl-setup.sh && bash -i kubectl-setup.sh
mkdir -p ~/bin ~/opt
## PATH
if ! [[ "$PATH" =~ (^|.*:)(~/bin/?|$HOME/bin/?)(:.*|$) ]]; then
echo 'PATH="~/bin:$PATH"' >> ~/.bashrc
export PATH="~/bin:$PATH"
fi
@gtx28
gtx28 / pve8arm-fresh.txt
Last active January 14, 2025 13:32
PVE8-ARM fresh install
***Pi-Mox8 setup on raspberry pi 4b & cm4
***Raspberry PI OS setup
***Install raspbian x64 lite on raspberry pi
pull the latest copy of Raspberry Pi Imager, from here https://www.raspberrypi.com/software/ and Raspberry PI OS x64 lite based on debian 12 bookworm from here: https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit
open imager, click choose os, scroll to the bottom and select custom. open the image "2024-11-19-raspios-bookworm-arm64-lite.img.xz"