Skip to content

Instantly share code, notes, and snippets.

@dfinke
dfinke / Show-GridView.ps1
Last active March 20, 2025 18:59
A PowerShell 7 function mimicking Out-GridView basics on Windows.
function Show-GridView {
param (
[Parameter(Mandatory, ValueFromPipeline)] $InputObject
)
begin {
Add-Type -AssemblyName System.Windows.Forms
$data = New-Object 'System.Collections.Generic.List[Object]'
}
process {
$data.Add([PSCustomObject]$InputObject)
@rhlobo
rhlobo / chat_md_format.py
Created February 19, 2024 03:14
Creates an markdown file from an Copilot Chat JSON
# You can export a Copilot Chat session in Visual Studio Code
# to a JSON file via `Ctrl+Shift+P | Chat: Export Session...`
# or by choosing `View > Command Palette | Chat: Export Session...`
# Inspired by https://github.com/Marijn-Bergman/copilot-chat-export-formatter
import sys
import json
@palumbo
palumbo / Download Images.gs
Created June 9, 2022 23:55
The code I used to download images into a Google Sheets cell or download images into a Google Drive folder.
function insertImage() {
let sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
let lastRow = sheet.getLastRow();
for (let i = 0; i < lastRow-1; i++) {
let url = sheet.getRange(2+i,1).getValue();
let image = SpreadsheetApp.newCellImage().setSourceUrl(url);
sheet.getRange(2+i,2).setValue(image);
}

Generate an SSH key

New standars recommands ed25519 over RSA as it tends to be faster and safer for more time.

Without security key

ssh-keygen -t ed25519 -C [email protected]
@joelotz
joelotz / cue2labels.py
Last active September 6, 2025 04:28
Convert a music .cue file into a label file. This module will accept an optional string attribute that specifies the input .cue file. If this file is not provided in the call then file-select box will be presented to the user. Output is a .txt file of labels that can be input into Audacity.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Convert a music .cue file into a label file.
This module will accept an optional string attribute that specifies the input
.cue file. If this file is not provided in the call then file-select box will
be presented to the user. Output is a .txt file of labels that can be input
into Audacity.
Examples:
@codediodeio
codediodeio / config.js
Last active April 7, 2025 00:44
Snippets from the Firestore Data Modeling Course
import * as firebase from 'firebase/app';
import 'firebase/firestore';
var firebaseConfig = {
// your firebase credentials
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
@romuloctba
romuloctba / Dockerfile
Created November 29, 2018 01:51
Photoshop on Docker
# docker run -it \
# -v /tmp/.X11-unix:/tmp/.X11-unix \
# -v $HOME:/workspace \
# -e DISPLAY=$DISPLAY \
# --privileged
# photoshop
#
FROM jess/wine
MAINTAINER Jonathan Gautheron <[email protected]>
@NoMan2000
NoMan2000 / openssl.md
Last active October 10, 2024 12:03 — forked from zhiguangwang/openssl.md
Common OpenSSL Commands with Keys and Certificates

Common OpenSSL Commands with Keys and Certificates

SSL Info

Generate RSA private key with certificate in a single command

openssl req -x509 -newkey rsa:4096 -sha256 -keyout example.key -out example.crt -subj "/CN=example.com" -days 3650 -passout pass:foobar

Generate Certificate Signing Request (CSR) from private key with passphrase

openssl x509 -x509toreq -in example.crt -out example.csr -signkey example.key -passin pass:foobar

@davewongillies
davewongillies / How-to Use a serial connection to your Netgear ReadyNAS.md
Last active February 8, 2025 11:05
How-to: Use a serial connection to your Netgear ReadyNAS

Taken from http://damsteen.nl/blog/how-to-use-a-serial-connection-to-your-netgear-readynas as it always seems to be down

How-to: Use a serial connection to your Netgear ReadyNAS

It is possible to connect to the command-line interface of your Netgear ReadyNAS using a serial connection. I have seen a very old blog post on the internet describing how to connect via serial to a Infrant ReadyNAS NV but it wasn't very clear how to connect to a Netgear ReadyNAS NVX Pioneer Edition, which I have. I guess I'm not the only one who wants to connect to their ReadyNAS, so I'm sharing my knowlegde here :)

The obvious advantages of a serial connection to your ReadyNAS is that you can experiment with network settings without the fear of rendering your NAS inaccessible. I believe it is also possible to recover the firmware in the event an update fails, although I haven't tried this myself.

Requirements