Skip to content

Instantly share code, notes, and snippets.

View osde8info's full-sized avatar

Clive D osde8info

View GitHub Profile
@Bill-Stewart
Bill-Stewart / Get-Uptime.ps1
Created June 1, 2018 20:37
Get-Uptime.ps1 - Use WMI to get last boot and uptime
# Get-Uptime.ps1
# Written by Bill Stewart (bstewart@iname.com)
#
# Outputs uptime for one or more computers. Uptime is determined by the
# LastBootUpTime property from the Win32_OperatingSystem WMI class.
#requires -version 2
<#
.SYNOPSIS
# Get-DirStats.ps1
# Written by Bill Stewart
# Outputs file system directory statistics.
#requires -version 2
<#
.SYNOPSIS
Outputs file system directory statistics.
@SteveL-MSFT
SteveL-MSFT / base64.ps1
Last active October 14, 2022 14:28
PowerShell Base64 Encode/Decode test
# Base64 algorithm borrowed from https://en.wikibooks.org/wiki/Algorithm_Implementation/Miscellaneous/Base64
function ConvertTo-Base64String ($string)
{
$base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
$result = [System.Text.StringBuilder]::new()
$pad = ""
$count = $string.Length % 3;
# string needs to be multiple of 3 characters
{
"extends": ["airbnb-base"],
"env": {
"browser":true,
"commonjs": true,
"node": true,
"es6": true
},
"rules": {
@mywarr
mywarr / .prettierrc
Created April 4, 2018 04:46
.prettierrc
{
"printWidth": 120,
"singleQuote": true,
"useTabs": false,
"tabWidth": 2,
"semi": true,
"bracketSpacing": true
}
@json2d
json2d / deptree-json-sync.js
Created August 4, 2017 16:10
Walk through dependency tree of installed packages via `npm ls`
const spawn = require('cross-spawn');
const path = require('path')
const ls = spawn.sync('npm', ['ls','--json']);
const tree = JSON.parse(ls.stdout)
const walkDepTree = (tree,cb) => {
const deps = tree.dependencies
if(deps) {
@zkat
zkat / index.js
Last active March 10, 2024 14:32
npx is cool
#!/usr/bin/env node
console.log('yay gist')
@ysmood
ysmood / rsync.sh
Created January 20, 2016 08:51
rsync
rsync -a --exclude='.git/' /a /b
@dhei
dhei / common-tasks.md
Last active October 14, 2022 15:03
PowerShell and Batch Cheatsheet
@jasondmoss
jasondmoss / simpleXmlToArray.php
Last active June 22, 2022 21:12
Convert a SimpleXML object to associative array
<?php
/**
* Convert a SimpleXML object to an associative array
*
* @param object $xmlObject
*
* @return array
* @access public
*/