Skip to content

Instantly share code, notes, and snippets.

@martindale
martindale / parseTitleString.js
Last active September 25, 2020 01:33
Parse a string, such as a YouTube video title, for artist and track information.
// TODO: provide an array of potential separators
// var SEPARATORS = [' - ', ' – ', ' -- ']
// note that these can have spaces, but sometimes do not
// TODO: output a testing dataset for changes to this function.
var TRACK_SEPARATOR = ' - ';
function parseTitleString(string, partsCallback) {
var artist, title, credits = [];
var string = string || '';
@modesto
modesto / PowerShell-CheatSheet.md
Last active March 16, 2021 17:19
PowerShell-CheatSheet

Memory allocated for each proccess:

get-process | Group-Object -Property ProcessName | Format-table Name, @{n='Mem (KB)';e={'{0:N0}' -f (($_.Group|Measure-Object WorkingSet -Sum).Sum / 1KB)};a='right'} -AutoSize

Get Temp folder:

$env:TEMP  # 8+3 format
@balupton
balupton / README.md
Last active June 7, 2021 16:00
Node.js Best Practice Exception Handling
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; This should be replaced by whatever your native language is. See
; http://msdn.microsoft.com/en-us/library/dd318693%28v=vs.85%29.aspx
; for the language identifiers list.
ru := DllCall("LoadKeyboardLayout", "Str", "00000419", "Int", 1)
@srt4rulez
srt4rulez / AutoHotKey.ahk
Last active March 28, 2022 11:44
Autohotkey
;-------------------------------------------------------------------------------
; Jake's AutoHotKey.ahk
;
; For Reference:
;
; Hotkey Modifiers
; # - Windows key
; ! - Alt
; ^ - Control
; + - Shift
@pongstr
pongstr / shorthand-javascript-techniques.md
Last active June 22, 2022 20:09
Shorthand Coding Techniques. Original post by @samdeering http://www.sitepoint.com/shorthand-javascript-techniques/

Javascript Shorthand Coding Techniques

My (@pongstr) opinion about shorthand coding techniques

Shorthand code is not really a replacement for normal coding but it is very handy and useful in some cases. There are tons of opinions and debates around this but, again it all comes down what is necessary for your codebase and using it responsibly.

'''''''''''''''''''''''''''''
' Purpose: Allows you to easily get the RAM configuration of a computer. LAN Sweeper won't tell you the RAM type, but this utility will. This should be useful for RAM upgrades.
' Requirements: Probably admin in Active Directory
' Written by: Alex Yancey
' Date: September 15, 2016
'''''''''''''''''''''''''''''
' More info about SMBIOS can be found in the SMBIOS specification: https://www.dmtf.org/standards/smbios, and from this article: http://www.codeguru.com/cpp/misc/misc/system/article.php/c12347/SMBIOS-Demystified.htm
computer_name = InputBox("Computer name: ", "RAM Identifier")
@sidneys
sidneys / youtube-classic.sort-rearrange-organize-playlists.js
Last active August 11, 2022 15:52
Greasemonkey | YouTube | Advanced Playlist Sorting
// ==UserScript==
// @name YouTube (Classic) | Sort, Rearrange & Organize Playlists
// @namespace de.sidneys.userscripts
// @homepage https://gist.githubusercontent.com/sidneys/27e704ec4a1d9bad311d634cbab2f218/raw/
// @version 29.0.0
// @description Organize and rearrange your YouTube playlists. Real server-side sorting by duration, title, channel and language.
// @author sidneys
// @icon https://www.youtube.com/favicon.ico
// @noframes
// @include http*://www.youtube.com/*
@javajawa
javajawa / 'Standard' Tags
Created November 21, 2011 15:42
Foobar Formatting for my Tag sets
Track Title=TITLE;
SubTitle=SUBTITLE;
Artist Name=ARTIST;
Album Title=ALBUM;
Compostition=COMPOSITION;
Date=DATE;
Genre=GENRE;
Composer=COMPOSER;
Performer=PERFORMER;
Conductor=CONDUCTOR;
@zenorocha
zenorocha / multiple-3rd-party-widgets.js
Last active November 14, 2022 12:18
Loading multiple 3rd party widgets asynchronously
(function() {
var script,
scripts = document.getElementsByTagName('script')[0];
function load(url) {
script = document.createElement('script');
script.async = true;
script.src = url;
scripts.parentNode.insertBefore(script, scripts);