Skip to content

Instantly share code, notes, and snippets.

View royashbrook's full-sized avatar

Roy Ashbrook royashbrook

View GitHub Profile
@jhorsman
jhorsman / Cisco_Anyconnect.ps1
Created January 6, 2015 10:11
PowerShell to automate VPN connection with Cisco AnyConnect Secure Mobility Client
#Source www.cze.cz
#This script is tested with "Cisco AnyConnect Secure Mobility Client version 3.1.00495"
# Usage: & '.\Cisco_Anyconnect.ps1' [-Server <server name or ip>] [-Group <group>] [-User <user>] [-Password <password>]
#Please change following variables
#IP address or host name of cisco vpn, Username, Group and Password as parameters
param (
[string]$Server = $( Read-Host "Input server, please" ),
@santisbon
santisbon / Search my gists.md
Last active November 18, 2024 21:00
How to search gists.

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@fnky
fnky / ANSI.md
Last active November 19, 2024 18:05
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@colinbendell
colinbendell / js-get-last-array-entry.js
Last active December 16, 2021 20:29
Compare Javascript v8 .slice.pop() vs. .slice(-1) memory and timing performance
const { PerformanceObserver, performance, constants } = require('perf_hooks');
const MAX_TEST_SIZE = Math.pow(2,16); //65536
// pre-allocate an array filled with objects (primatives like Number and Boolean have internal cpp optimizations)
const a = new Array(MAX_TEST_SIZE).map(v => ({}));
// pre-allocate an array for the results. this way we don't count the heap overhead from assigning the target variables
const b = new Array(MAX_TEST_SIZE);
let totalHeapUsed = 0;
let heapUsed = 0;