Skip to content

Instantly share code, notes, and snippets.

View hexandcube's full-sized avatar
🦊

Hexandcube hexandcube

🦊
View GitHub Profile
@hexandcube
hexandcube / hugo-shields-io-shortcode.html
Last active April 27, 2019 16:54
Hugo shortcode for shields.io custom badge
{{if .Get "link"}}
<a href="{{.Get "link"}}" target="{{.Get "target"}}" {{if .Get "class"}} class="{{.Get "class"}}" {{end}} style="text-decoration-line: none;">
{{end}}
<img alt="{{.Get "alt"}}" style="display: inline-block;" src="https://img.shields.io/badge/{{if .Get "label"}}{{.Get "label"}}{{end}}{{if .Get "message"}}-{{.Get "message"}}{{end}}{{if .Get "color"}}-{{.Get "color"}}{{end}}.svg?logo={{.Get "logo"}}&logoColor={{.Get "logoColor"}}&logoWidth={{.Get "logoWidth"}}&style={{.Get "style"}}">
{{if .Get "link"}}
</a>
{{end}}
<script type="text/javascript">
"use strict";
function loadPage(pwd) {
var pwd_sha1 = new jsSHA("SHA-1", "TEXT");
var hash = pwd;
pwd_sha1.update(pwd);
hash = pwd_sha1.getHash("HEX");
var url = hash + "/index.html";
@hexandcube
hexandcube / getUtcTime.js
Created October 10, 2019 19:29
Get time for diffrent timezones
// UTC Offset (in hours)
var utcOffset = 0;
d = new Date();
utc = d.getTime() + (d.getTimezoneOffset() * 60000)
outputTime = new Date(utc + (3600000 * utcOffset));
outputTimeString = `${outputTime.toLocaleTimeString()} UTC+${utcOffset}`
@hexandcube
hexandcube / delete-all-youtube-comments.js
Created January 23, 2020 14:12
Script that deletes all of your youtube comments
// Original Script: https://github.com/ian-campbell/Erasure
// Go to https://www.youtube.com/feed/history/comment_history
// Open Developer Console (F12), paste the script and hit enter
// Tested on Firefox and Chromium
var DELAY = 0; // try 0, then try increasing values
var myList = document.getElementsByClassName("dropdown-trigger style-scope ytd-menu-renderer");
//second delete button
@hexandcube
hexandcube / Microsoft.Powershell_profile.ps1
Created July 31, 2020 20:37
Clean, Bash-like Powershell prompt
function global:prompt {
Write-Host -Object "$($env:USERNAME)@$([System.Net.Dns]::GetHostName())" -NoNewline -ForegroundColor Green
Write-Host -Object ":" -NoNewline -ForegroundColor White
Write-Host -Object "$(Get-Location)" -NoNewline -ForegroundColor DarkRed
$IsAdmin = (New-Object Security.Principal.WindowsPrincipal ([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
return $(if ($IsAdmin) { '# ' } else { '$ ' })
}
@hexandcube
hexandcube / settings.json
Last active July 31, 2020 20:57
Hexandcube's Windows Terminal Configuration
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"copyOnSelect": false,
"copyFormatting": false,
"profiles": {
"defaults": {
"colorScheme": "Lab Fox",
"fontFace": "Cascadia Code",
@hexandcube
hexandcube / readme.md
Last active February 8, 2021 12:00
Bulma screen debugger by Hexandcube - displays the current breakpoint in the bottom-left corner of the screen

Bulma screen debug by Hexandcube

  1. Put screendebug.scss in the same directory as your Bulma.sass file,
  2. Import screendebug in your bulma.sass file using `@import "screendebug"
  3. Add a div with id="screendebug" as a first child, and wrap the rest of the page in a seperate div
<body>
  <div id="screendebug"></div>
  <div class="pagewrapper"></div>
rules:
- folders: 'C:\'
filters:
- extension:
- .jpg
- .jpeg
- .png
- .mp4
- .mkv
- .avi