Skip to content

Instantly share code, notes, and snippets.

@qqii
qqii / CrystalDiskMark-TortureTest.ps1
Created August 19, 2023 17:18
Disk torture test by repeatedly running the default CrystalDiskMark benchmark
# Repeatedly runs the default CrystalDiskMark benchmark:
#
# Random Data, 1GiB
# Test Count 5
# Interval 5s, Measure 5s, Read then Write
# SEQ1M Q8T1
# SEQ1M Q1T1
# RND4K Q32T1
# RND4K Q1T1
#
@qqii
qqii / GitHubCopilotCLIAlias.ps1
Last active May 25, 2023 07:39 — forked from MattJeanes/GitHubCopilotCLIAlias.ps1
Alias commands to use GitHub Copilot CLI in PowerShell
# You should insert this script into your PowerShell Profile script so it exists in every session
# Fun fact: This script was mostly generated by ChatGPT by giving it the bash version of the output
# from `github-copilot-cli alias -- "$0"` with a few fixes from me
function Invoke-CopilotWhatTheShell {
$TMPFILE = New-TemporaryFile;
try {
github-copilot-cli what-the-shell $args --shellout $TMPFILE
if ($LASTEXITCODE -eq 0) {
@qqii
qqii / New-GourceMultiRepo.ps1
Last active November 5, 2022 00:51 — forked from Sotilrac/gource-multi-repo.sh
Generates gource video out of multiple repositories. Uses avconv to export the video file.
# Automatically run gource on multiple repositories
# https://github.com/acaudwell/Gource/wiki/Visualizing-Multiple-Repositories
$Resolution = "1920x1080"
$Title = "Software Development"
$Output = "output.mp4"
$BackgroundColour = "38383D"
$FPS = "30"
$Repositories = @('artcam-express-store', 'bin2c', 'blackbox', 'carveco', 'carveco-icons', 'carveco-po', 'carveco-release-sandbox', 'ccuser', 'ddx', 'ddxman', 'delcam-cmake', 'derek-the-goat', 'dgkman', 'diagnostics', 'dongle-emulator-service', 'genman', 'grafman', 'guiman', 'hallmark', 'health-check', 'herbert-walker', 'legacy-decryption-service', 'legacy-decryption-table-generator', 'licence-api', 'license-server', 'mcuser', 'mswman', 'package-recipies', 'partner-portal', 'pdftron', 'pmpost', 'psteam-slack-bot', 'shopify-auth0', 'toolbox-addins', 'translation-wizard', 'tvd', 'vroni'<#,'vcpkg'#>)
# $Repositories = @('health-check', 'partner-portal', 'licence-api')
@qqii
qqii / config.js
Created January 31, 2021 16:02
Surfingkeys Config with nicer hint theme
// an example to create a new mapping `ctrl-y`
mapkey('<Ctrl-y>', 'Show me the money', function() {
Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).');
});
// an example to replace `T` with `gt`, click `Default mappings` to see how `T` works.
map('gt', 'T');
@qqii
qqii / .gitconfig
Created February 3, 2018 18:32
gitconfig
[user]
email = Qi-rui.Chen.2015@my.bristol.ac.uk
name = qqii
[status]
submodulesummary = true
[diff]
submodule = log
[credential]
helper = cache --timeout=86400
[core]
@qqii
qqii / Event.cpp
Last active February 22, 2018 23:59
"Dynamic" dispatch...
#include <unordered_map>
#include <functional>
#include <typeindex>
#include <typeinfo>
#include <memory>
class Event {
public:
virtual ~Event(){};
};
@qqii
qqii / hider.js
Last active May 22, 2017 01:38
Facebook Timeline Hider (22/05/17)
// Hides all posts on the timeline
// 1. Navitage to timeline
// 2. Run in console
// click the little down arrows next to posts
// gives hide elements their text
function clickDown() {
var d = document.getElementsByClassName("_4xev _p");
for (var i = 0; i < d.length && i < 5; i++) {
d[i].click();