Skip to content

Instantly share code, notes, and snippets.

View drannex42's full-sized avatar
🤖
Replicant? More likely than you would think.

Macleod Sawyer drannex42

🤖
Replicant? More likely than you would think.
View GitHub Profile
@supercheetah
supercheetah / Get-SwitchMACInfo.ps1
Last active October 9, 2024 02:56
A PowerShell script to get the MAC address tables from Cisco routers/switches
<#
.SYNOPSIS
This script gets MAC address tables from Cisco routers/switches running IOS using the SSH protocol.
.DESCRIPTION
There's a newer version of this here: https://github.com/supercheetah/winsysadmintools
The script uses the Plink (command line version of PuTTY, http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)
to get the output of the command "show mac address-table" and put into a object array (i.e. table) that is outputted to
Out-GridView, and can optionally be saved to a CSV file.
@umidjons
umidjons / youtube-dl-download-audio-only-on-best-quality.md
Last active November 14, 2024 21:20
Download Audio from YouTube with youtube-dl

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@SeanSobey
SeanSobey / .gitattributes
Last active November 4, 2022 08:57
Git to diff zip (or any compressed) files. See this (https://tante.cc/2010/06/23/managing-zip-based-file-formats-in-git/) article.
*.[7z,xz,bzip2,gzip,tar,zip,wim,ar,arj,cab,chm,cpio,cramfs,dmg,ext,fat,gpt,hfs,ihex,iso,lzh,lzma,mbr,.msi,nsis,ntfs,qcow2,rar,rpm,squashfs,udf,uefi,vdi,vhd,vmdk,wim,xar,z] diff=archive
@jesstelford
jesstelford / 01-shape-up-to-kindle.md
Last active November 17, 2024 13:20
Read SHAPE UP by basecamp on a Kindle / reMarkable / eReader

Read Shape Up by basecamp on a kindle / reMarkable / eReader

Basecamp's new book Shape Up is now available online (https://basecamp.com/shapeup) to read page-by-page.

There is a .pdf version, but that's not the best format for Kindle / other eReaders. Instead, we can convert the page-by-page into an eReader friendly format.

Part 1: Convert to a single page

NOTE: This has only been tested on Chrome

@imclint21
imclint21 / RustSpa.rs
Created August 2, 2019 15:21
Making an SPA Application In Rust with Rocket
#![feature(plugin)]
#![plugin(rocket_codegen)]
extern crate rocket;
use std::io;
use std::path::{Path, PathBuf};
use rocket::response::NamedFile;
@john-doherty
john-doherty / cordova-file-storage.js
Last active August 2, 2023 10:32
An easy way to read/write files in Cordova
var fileStorage = {
/**
* Saves a file on the device
* @param {string} name - filename (can include sub folders)
* @param {string} data - file contents
* @param {boolean} useSandbox - uses protected sandbox if true, otherwise external (default false)
* @returns {Promise} executes .then with saved file path as first param
*/
write: function (name, data, useSandbox) {

D web development package

These are some recommended D web development packages from Dub you may need. These following are choosing because I've either personally used them or they have good documentation.

Any recommendation? Please let me know in the comments.

Web frameworks

  • vibe-d (its like Express.js from Node.js/Javascript)
  • hunt-framework (its like Laravel from PHP)

Json parsing and serialization

@no-defun-allowed
no-defun-allowed / selling-lisp-by-the-pound.org
Last active April 17, 2024 06:10
Selling Lisp by the pound

Selling Lisp by the Pound

“Paper late!” cried a voice in the crowd,

“Old man dies!” The note he left was signed,

‘Old Kiczales’ - it seems he’s drowned!

@drannex42
drannex42 / check_env.odin
Last active October 29, 2024 16:14
Environment File (.env) Reader [Odin]
// Two options:
// Option 1: set a struct that stores the values,
// Option 2: Use the native Environment Variable options:
// https://pkg.odin-lang.org/core/os/#set_env
// Option 1:
Global_Env :: struct {
USER: string,
PWD: string
}