Skip to content

Instantly share code, notes, and snippets.

View illusive-man's full-sized avatar

Serge Kanashin illusive-man

View GitHub Profile
@evanmwillhite
evanmwillhite / menu.js
Last active June 22, 2018 14:45
Multi-level Responsive Menu with vanilla JS (IE10+). Children completely hidden on large screens.
(function () {
'use strict';
var mainMenuToggle = document.getElementById('main-menu-toggle');
var mainMenu = document.getElementById('main-menu');
var mainMenuList = document.getElementById('main-menu__list');
var mainMenuClose = document.getElementById('main-menu__close');
var mainMenuParent = document.querySelectorAll('.main-menu__item--with-child > a');
var mainMenuBack = document.querySelectorAll('.main-menu__back');
@mklement0
mklement0 / Get-CmdletMinPsVersion.ps1
Last active November 22, 2019 15:57
Get-CmdletMinPsVersion: PowerShell function for determining the minimum PowerShell version required to run given standard cmdlets.
function Get-MinPsVersionForCmdlet {
<#
.SYNOPSIS
Determines the minimum PowerShell version required for a given standard cmdlet.
.DESCRIPTION
NOTE:
* v3 or higher is required to run this function.
* Only cmdlets with help topics defined in the GitHub
PowerShell-documentation repository at
@Vestride
Vestride / speedruns.js
Last active December 29, 2020 08:10
Parses the Halo Waypoint MCC campaign page and calculates your total time as well as a per-mission breakdown of your timings.
(function() {
/**
* Par times for each mission.
* <mission-id, minutes>
*/
var parTimes = {
// Halo 1
0: { par: 15, name: 'The Pillar of Autumn' },
1: { par: 20, name: 'Halo' },
@kumarharsh
kumarharsh / system-environment-snippets
Last active June 18, 2021 17:05
[Powershell] Update Environment Variable one-liner
# These snippets provide a quick way to update your environment variables
# directly from your powershell console. Just copy paste these lines, or
# even better, add it to your profile as functions.
# refreshing env in current shell
$env:path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
# adding path to env
# set path in the $_newPath variable, and it'll get set to your user environment path and persisted.
$_newPath=""; [System.Environment]::SetEnvironmentVariable("Path", [System.Environment]::GetEnvironmentVariable("Path", "User") + ";${_newPath}", "User")
@JingwenTian
JingwenTian / composer.json.md
Created October 4, 2014 12:28
Composer Cheat Sheet for developers ( http://composer.json.jolicode.com/ )

###Composer Cheat Sheet for developers

Composer is the dependency manager for PHP and you are on a one-page-only documentation for this tool. Official documentation is on the official website, this page just brings you the essential.

One line installer

curl -sS https://getcomposer.org/installer | php

composer.phar command line

@marnix
marnix / Remove-File-Eventually.ps1
Created November 20, 2013 15:47
PowerShell command to delete a file, if possible immediately, and if it is in use at the next boot.
param(
[parameter(Mandatory=$true)]
[string] $path
)
# the code below has been used from
# https://blogs.technet.com/b/heyscriptingguy/archive/2013/10/19/weekend-scripter-use-powershell-and-pinvoke-to-remove-stubborn-files.aspx
# with inspiration from
# http://www.leeholmes.com/blog/2009/02/17/moving-and-deleting-really-locked-files-in-powershell/
# and error handling from
@ozh
ozh / gist:4131243
Created November 22, 2012 13:44
Create dot files/directories (ie .file) on Windows

#How to create a .file or .folder on Windows

There are several ways

1. Rename

  • Create file.txt
  • Rename to .file., the last dot will be dropped, you'll have .file

Works the same with a file or a directory.

@markwragg
markwragg / Sort-Natural.ps1
Last active February 5, 2024 12:16
PowerShell natural sort. A regex way to sort files that have a number in them correctly, e.g rather than img1, img10, img11, img2, -> img1, img2, img10, img11
# http://stackoverflow.com/a/5429048/2796058
$ToNatural = { [regex]::Replace($_, '\d+', { $args[0].Value.PadLeft(20) }) }
Get-ChildItem | Sort-Object $ToNatural
@angrycoffeemonster
angrycoffeemonster / Sublime Text 3 Build 3103 License Key - CRACK
Created April 18, 2016 02:13
Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
@marnix
marnix / createiso-demo.ps1
Last active April 9, 2024 14:03
Demo for PowerShell script to create ISO using IMAPI COM component, as a simplification for StackOverflow answer http://stackoverflow.com/a/8325316/223837
# Inspiration from
#
# http://blogs.msdn.com/b/opticalstorage/archive/2010/08/13/writing-optical-discs-using-imapi-2-in-powershell.aspx
#
# and
#
# http://tools.start-automating.com/Install-ExportISOCommand/
#
# with help from
#