Skip to content

Instantly share code, notes, and snippets.

(*
Toggle GlobalProtect VPN with AppleScript
Tested using macOS Sequoia 15.1.1 and GlobalProtect version 6.2.3-270
Written by Trevor Manternach, August 2023.
*)
tell application "System Events" to tell process "GlobalProtect"
click menu bar item 1 of menu bar 2
set statusText to name of static text 1 of window 1
if statusText is "Not Connected" then
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active March 15, 2025 01:49
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This does not works in browser for non-video, non-activity quests! For stream/play quests use the desktop app!

Note

When doing stream quests, you need at least 1 other account in the vc!

How to use this script:

  1. Accept a quest under Discover -> Quests
@heyvoon
heyvoon / OrganizeFolderbyFileType.ps1
Created March 15, 2025 01:48
This script organizes files in a specified folder into subfolders by file type.
<#
=============================================
File Cleanup Script for Downloads
Author: Your Name
Date: $(Get-Date -Format "yyyy-MM-dd HH:mm:ss")
=============================================
This script organizes files in a specified folder into subfolders:
- EXE/MSI files are moved to <Folder>\Organized Files\Installers
- Older versions of EXE/MSI files are moved to <Folder>\Organized Files\Installers\Old
- Compressed files (ZIP, 7Z, RAR, etc.) are moved to <Folder>\Organized Files\Compressed

Be Overly Liberal with Thresholds, not Slightly Conservative

A mistake I often see in software development is the way people choose thresholds. The developer is told they need to limit certain types of activity, for logical reasons, but they set the limits too strictly.

I recommend:

When setting a threshold, be generous to the user, and then double that. If a high threshold will still satisfy your requirements, then choose

@LeFreq
LeFreq / perfect_internet
Last active March 15, 2025 01:43
The Perfect Internet
Perfect Internet
Completing any ONE of the following would contribute perhaps a BILLION dollars to the cultural value of the Internet:
* Complete “creole” markup language for layout for all sites which allow collaboration (shared, meta-identity)
* Perfect voting model to handle all decetralized community discussion and decision-making (meritocracy)
* Micro-“bitcoin” monetary system of exchange for all virtual goods. (creative economy)
* Ontology and color/tag schema for all human knowledge (like the Library of Congress Subject Headings) (tree of knowledge) (color scheme is done at singularity project)
* data ecocsystem of universal objects + cyberspace visualization, (the +/-1) (See Singularity project combines all of these)
@timothyham
timothyham / ipv6guide.md
Last active March 15, 2025 01:41
A Short IPv6 Guide for Home IPv4 Admins

A Short IPv6 Guide for Home IPv4 Admins

This guide is for homelab admins who understand IPv4s well but find setting up IPv6 hard or annoying because things work differently. In some ways, managing an IPv6 network can be simpler than IPv4, one just needs to learn some new concepts and discard some old ones.

Let’s begin.

First of all, there are some concepts that one must unlearn from ipv4:

Concept 1

@notnotrobby
notnotrobby / cgp.md
Last active March 15, 2025 01:36
List of free resources to study computer graphics programming.
@Glavak
Glavak / CameraConstantWidth.cs
Last active March 15, 2025 01:34
Скрипт для поддержания постоянной ширины камеры в Unity, для туториала https://youtu.be/0cmxFjP375Y
using UnityEngine;
/// <summary>
/// Keeps constant camera width instead of height, works for both Orthographic & Perspective cameras
/// Made for tutorial https://youtu.be/0cmxFjP375Y
/// </summary>
public class CameraConstantWidth : MonoBehaviour
{
public Vector2 DefaultResolution = new Vector2(720, 1280);
[Range(0f, 1f)] public float WidthOrHeight = 0;
@mmozeiko
mmozeiko / !README.md
Last active March 15, 2025 01:30
Download MSVC compiler/linker & Windows SDK without installing full Visual Studio

This downloads standalone MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for native desktop app development.

Run py.exe portable-msvc.py and it will download output into msvc folder. By default it will download latest available MSVC & Windows SDK - currently v14.40.33807 and v10.0.26100.0.

You can list available versions with py.exe portable-msvc.py --show-versions and then pass versions you want with --msvc-version and --sdk-version arguments.

To use cl.exe/link.exe first run setup_TARGET.bat - after that PATH/INCLUDE/LIB env variables will be updated to use all the tools as usual. You can also use clang-cl.exe with these includes & libraries.

To use clang-cl.exe without running setup.bat, pass extra /winsysroot msvc argument (msvc is folder name where output is stored).

@rleaf
rleaf / index.html
Created December 10, 2019 18:47
Ionic Modal - Fullscreen images
<html ng-app="ionicApp">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>Ionic Fullscreen Image</title>
<link href="//code.ionicframework.com/1.0.0-rc.1/css/ionic.min.css" rel="stylesheet">
<script src="//code.ionicframework.com/1.0.0-rc.1/js/ionic.bundle.js"></script>
</head>