Skip to content

Instantly share code, notes, and snippets.

View rjmccallumbigl's full-sized avatar
🌞

Ryan McCallum rjmccallumbigl

🌞
View GitHub Profile
@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
@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
@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
@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.
@ataylor32
ataylor32 / beep_mario_victory_theme.ps1
Created July 24, 2014 05:02
Beep: Mario Victory Theme
[Console]::Beep(130, 100)
[Console]::Beep(262, 100)
[Console]::Beep(330, 100)
[Console]::Beep(392, 100)
[Console]::Beep(523, 100)
[Console]::Beep(660, 100)
[Console]::Beep(784, 300)
[Console]::Beep(660, 300)
[Console]::Beep(146, 100)
[Console]::Beep(262, 100)
@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 {
@mharizanov
mharizanov / WiFiCheck
Created April 6, 2013 08:50
Script to check and re-connect WiFi on Raspberry Pi
#!/bin/bash
##################################################################
# A Project of TNET Services, Inc
#
# Title: WiFi_Check
# Author: Kevin Reed (Dweeber)
# dweeber.dweebs@gmail.com
# Project: Raspberry Pi Stuff
#
# Copyright: Copyright (c) 2012 Kevin Reed <kreed@tnet.com>
@KartikTalwar
KartikTalwar / google-apps-script-json-parser.gs
Created January 10, 2017 02:07
Google Apps Script JSON Parser
// call this function on a cell via =ImportJSON("http://...") and data will show up verbatim
function ImportJSON(url) {
var response = UrlFetchApp.fetch(url);
var data = JSON.parse(response.getContentText());
if (!data.length) {
return [];
}
var rows = [];
@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
@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.