Skip to content

Instantly share code, notes, and snippets.

@prantlf
prantlf / open.pws.txt
Created Jan 27, 2021
How to add a menu item opening Personal Workspace to the user profile menu.
View open.pws.txt
src/commands/profile.menuitems.js (add menu items):
define(function () {
return {
profileMenu: [
{
signature: 'myext-open-pws',
name: 'Go to Personal Workspace',
group: 'others'
}
@prantlf
prantlf / icon.for.dwg.documents.txt
Created Jan 15, 2021
How to assign a custom icon to AutoCAD drawings.
View icon.for.dwg.documents.txt
src/icons/images/dwg.svg:
The icon image content.
src/icons/icons.css:
.binf-widgets .acad-mime-dwg {
background-image: url('images/dwg.svg');
}
@prantlf
prantlf / icon.for.subtype.txt
Created Jan 15, 2021
How to assign a custom icon to a specific subtype.
View icon.for.subtype.txt
src/icons/images/mytype.svg:
The icon image content.
src/icons/icons.css:
.binf-widgets .myext-mytype {
background-image: url('images/mytype.svg');
}
@prantlf
prantlf / diablo2_instructions.md
Created Dec 18, 2020 — forked from rodrigore/diablo2_instructions.md
Diablo2 on Mac OSX El Capitan
View diablo2_instructions.md

Diablo II LoD on Mac OSX El Capitan

These are the instructions for using Terminal to install the Windows version of the game onto your machine. You can then easily copy the game multiple times for different mods you might want to play.

In this guide you'll end up with:

@prantlf
prantlf / kextsthatwillmakeanadmincry.py
Last active Dec 15, 2020 — forked from erikng/kextsthatwillmakeanadmincry.py
Prints kernel extensions on OSX
View kextsthatwillmakeanadmincry.py
#!/usr/bin/python
# Credit to frogor for the objc
from Foundation import NSBundle
import json
import objc
import os
import plistlib
import subprocess
View p4-diff-changelist.py
#!/usr/bin/env python3
#
# Copyright 2014-2020 Cameron Hart <cameron.hart@gmail.com>.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
@prantlf
prantlf / main_test.go
Last active May 28, 2021
Tests and benchmarks for formatting integers with commas separating thousands
View main_test.go
// Save this file as main_test.go and run "go test -bench ."
package main
import (
"bytes"
"fmt"
"regexp"
"strconv"
"testing"
@prantlf
prantlf / package.json
Last active Oct 1, 2019
Serves files from the current directory and subdirectories over HTTP for local development purposes using multiple workers.
View package.json
{
"name": "dev-http-server",
"version": "0.0.1",
"description": "Development HTTP server serving the current duirectory.",
"license": "MIT",
"author": "Ferdinand Prantl <prantlf@gmail.com> (http://prantl.tk/)",
"contributors": [],
"homepage": "https://gist.github.com/prantlf/2514e4b43b8c6ef6ab08a4d2084a69ba",
"repository": "https://gist.github.com/prantlf/2514e4b43b8c6ef6ab08a4d2084a69ba",
"bugs": "https://gist.github.com/prantlf/2514e4b43b8c6ef6ab08a4d2084a69ba",
@prantlf
prantlf / har2paths.js
Last active Sep 29, 2019
Extract URL paths from a HAR file
View har2paths.js
// Useful for generating a list of paths for performance testing using `wrk`
// and https://github.com/timotta/wrk-scripts/blob/master/multiplepaths.lua.
const description = `Usage: node har2paths (file.har) > paths.txt
Prints URL paths of all server calls made while loading the first page
from the HAR file, which has been created for a SPA.`
const harName = process.argv[2]
if (!harName) {
@prantlf
prantlf / nginx.conf
Last active Sep 29, 2019 — forked from foxxyz/nginx.conf
Serve current directory via nginx
View nginx.conf
# Simple development setup to serve a directory at http://localhost:9001.
# Start nginx in the directory to serve with `nginx -c ~/nginx.conf`.
# When using a laptop with an above average equipment. 2 workers
# significantly increase the throughput. 4 workers still help
# noticeably. The server slows down With more than 6 workers.
worker_processes 2;
events {
accept_mutex off;
}