Skip to content

Instantly share code, notes, and snippets.

View rjmccallumbigl's full-sized avatar
🌞

Ryan McCallum rjmccallumbigl

🌞
View GitHub Profile
@tanaikech
tanaikech / submit.md
Last active August 12, 2022 06:31
Report: Documentation Comments including JsDoc for Functions of Google Apps Script

Report: Documentation Comments including JsDoc for Functions of Google Apps Script

This is a report for the documentation comments for the functions of Google Apps Script.

When the documentation comments for functions of Google Apps Script are considered, you will think JsDoc. At Google Apps Script, a part of JsDoc can be used. But, in this report, I would like to introduce the documentation comments including JsDoc.

Sample situations

Sample 1

@sdwheeler
sdwheeler / parse-netstat.ps1
Created September 29, 2021 00:05
Example for parsing the output from netstat
function parseNetstat {
param([object[]]$Lines)
if ($IsWindows) {
$skip = 4
} else {
$skip = 3
}
$Lines | Select-Object -Skip $skip | ForEach-Object {
@jhochwald
jhochwald / Get-AllCookiesFromWebRequestSession.ps1
Created January 5, 2021 23:34
Get all cookies stored in the WebRequestSession variable from any Invoke-RestMethod and/or Invoke-WebRequest request
function Get-AllCookiesFromWebRequestSession
{
<#
.SYNOPSIS
Get all cookies stored in the WebRequestSession variable from any Invoke-RestMethod and/or Invoke-WebRequest request
.DESCRIPTION
Get all cookies stored in the WebRequestSession variable from any Invoke-RestMethod and/or Invoke-WebRequest request
The WebRequestSession stores useful info and it has something that some my know as CookieJar or http.cookiejar.
@Bajena
Bajena / Oauth.gs
Created June 23, 2018 19:16
Google script functions for performing simple Spotify Oauth flow
var oauth = {};
/** @const */
oauth.OAUTH_CLIENT_ID = 'OAUTH_CLIENT_ID';
/** @const */
oauth.OAUTH_CLIENT_SECRET = 'OAUTH_CLIENT_SECRET';
/**
* This builds an OAuth2 service for connecting to Spotify
@davebrny
davebrny / txt.swap.ahk
Last active January 11, 2024 07:23
(autohotkey) - swap text at a certain character or word, interactively
#noEnv
#singleInstance, force
sendMode input
return ; end of auto-execute ---------------------------------------------------
!s:: goSub, text_swap
!+s::goSub, repeat_last_swap
; !+s::goSub, repeat_last_swap_interactive
@nikonthethird
nikonthethird / Minesweeper.ps1
Last active April 5, 2024 14:55
PowerShell Minesweeper
#Requires -Version 5.1
Using Assembly PresentationCore
Using Assembly PresentationFramework
Using Assembly WindowsBase
Using Namespace System.Collections.Generic
Using Namespace System.Collections.ObjectModel
Using Namespace System.Globalization
Using Namespace System.Reflection
Using Namespace System.Windows
@nikonthethird
nikonthethird / Snake.ps1
Last active April 18, 2024 00:19
PowerShell script for playing Snake.
#Requires -Version 5.1
Using Assembly PresentationCore
Using Assembly PresentationFramework
Using Namespace System.Collections.Generic
Using Namespace System.ComponentModel
Using Namespace System.Linq
Using Namespace System.Reflection
Using Namespace System.Text
Using Namespace System.Windows
Using Namespace System.Windows.Input
@tanaikech
tanaikech / submit.md
Last active January 10, 2024 02:00
Multipart-POST Request Using Google Apps Script

Multipart-POST Request Using Google Apps Script

April 20, 2019: GAS library for this situation was published. Please check it at https://github.com/tanaikech/FetchApp.

These sample scripts are for requesting multipart post using Google Apps Script.

In most cases, the multipart request is used for uploading files. So I prepared 2 sample situations as follows. For each situation, the request parameters are different.

  1. Upload a file from Google Drive to Slack.
  2. Convert an excel file to Spreadsheet on Google Drive using Drive API v3.
@alexjebens
alexjebens / ghost-network-adapters-powershell.ps1
Last active January 22, 2023 22:55
Remove Ghost Network Adapters with PowerShell only
$T = @"
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace Win32
{
public static class SetupApi
{
// 1st form using a ClassGUID only, with Enumerator = IntPtr.Zero
@alexjebens
alexjebens / ghost-network-adapters-devcon.ps1
Last active September 2, 2022 17:33
Removing Ghost Network Adapters with Windows SDK devcon.exe
param(
# Path to devcon.exe
[string]$devconPath = "C:\Program Files (x86)\Windows Kits\8.0\Tools\x64\devcon.exe"
)
<#
.Synopsis
Helper function to seperate devcon output between device id and name
#>
function Convert-ToDevice {
[CmdletBinding()]