Skip to content

Instantly share code, notes, and snippets.

View Tcip's full-sized avatar

Mikael Elmblad Tcip

View GitHub Profile
@Tcip
Tcip / view Twitch Schedule Bookmarklet.js
Created April 2, 2024 18:50
This will take you to the schedule tab for the current Twitch channel you are watching.
javascript:(function(){location.href=location.href.substring(location.href.indexOf(location.pathname)).concat('/schedule')})()
@Tcip
Tcip / echo Windows Edition (variable version).bat
Created March 27, 2024 21:42
echo Windows Edition using the PowerShell environment variable POWERSHELL_DISTRIBUTION_CHANNEL. This version store the data in a variable and then call it with echo command
@echo off
SET _we="%POWERSHELL_DISTRIBUTION_CHANNEL%"
FOR /F "tokens=* delims=MSI:" %%G IN (%_we%) DO SET _newvar=%%G
echo. %_newvar%
pause
@Tcip
Tcip / echo Windows Edition.bat
Created March 27, 2024 20:31
echo Windows Edition using the PowerShell environment variable POWERSHELL_DISTRIBUTION_CHANNEL
@echo off
SET _we="%POWERSHELL_DISTRIBUTION_CHANNEL%"
FOR /F "tokens=* delims=MSI:" %%G IN (%_we%) DO echo %%G
pause
@Tcip
Tcip / extension[dismissable].js
Created September 8, 2023 23:02
dismissable notification for Visual Studio Code extension
/*
vbscript-format by vsmalone -- Visual Studio Code Extension
https://marketplace.visualstudio.com/items?itemName=vsmalone.vbscript-format
%USERPROFILE%\.vscode\extensions\vsmalone.vbscript-format-0.0.2\extension.js
Line 13
*/
// vscode.window.showInformationMessage('完成');
vscode.window.showInformationMessage('Finish'),
@Tcip
Tcip / Show the time with variable.bat
Created March 8, 2023 18:10
Show the time with variable. Hours, minutes, seconds
@echo off
REM Show the time (hours, minutes, seconds) with variable
REM https://groups.google.com/g/microsoft.public.win2000.cmdprompt.admin/c/CHS0gwjZQDA/m/L85IIcFcLgkJ
REM <nul (set/p z=sec min hours: %time:~6,2% %time:~3,2% %time:~0,2%)
title %~nx0
cls
cd %~dp0
echo.
echo Show the time with variable
echo.
@Tcip
Tcip / Create a InternetShortcut (Variable method + url with spaces).bat
Created December 12, 2022 11:32
Create a InternetShortcut (.url) file. Variable method. And URL with spaces.
@echo off
REM Create a InternetShortcut (.url)
SET _name="Example.com"
SET "_website=https://example.com/hello world"
echo [InternetShortcut] > "%_name%.url"
echo URL=%_website% >> "%_name%.url"
REM Example.com.url
@Tcip
Tcip / Create a InternetShortcut (url with spaces).bat
Created December 12, 2022 11:27
Create a InternetShortcut (.url) file. URL with spaces.
@echo off
REM Create a InternetShortcut (.url)
echo [InternetShortcut] > "Example.com.url"
echo URL="https://example.com/hello world" >> "Example.com.url"
REM Example.com.url
@Tcip
Tcip / Create a InternetShortcut.bat
Created December 12, 2022 11:15
Create a InternetShortcut (.url) file.
@echo off
REM Create a InternetShortcut (.url)
echo [InternetShortcut] > "Example.com.url"
echo URL=https://example.com >> "Example.com.url"
REM Example.com.url
@Tcip
Tcip / Create a InternetShortcut (Variable method).bat
Last active December 12, 2022 12:16
Create a InternetShortcut (.url) file. Variable method.
@echo off
REM Create a InternetShortcut (.url)
SET _name="Example.com"
SET _website="https://example.com"
echo [InternetShortcut] > "%_name%.url"
echo URL=%_website% >> "%_name%.url"
REM Example.com.url
@Tcip
Tcip / IMGappendChild.js
Created March 27, 2022 05:57
Print out all images on the page
var images=$$("img");for(each in images){var mdiv=document.createElement("P");document.body.appendChild(mdiv);mdiv.innerHTML=images[each].src};