Skip to content

Instantly share code, notes, and snippets.

@loretoparisi
loretoparisi / wavesurfer.js
Last active December 20, 2023 00:08
Wavesurfer js setup with timing labels and time formating callback
/**
* Wavesurfer.js minimalistic example with
* regions loading, save, plugins, waveform loading from json, waveform zoom, player events, keyboard codes, auto play
* @author: Loreto Parisi (loretoparisi at gmail dot com) - mainly, some code and functions adpated from Wavesurfer examples
* @disclaimer: code adapted from online examples
*/
// JavaScript
// Wrap the native DOM audio element play function and handle any autoplay errors
@F1XI
F1XI / FolderPicker.ps1
Created July 29, 2022 15:53
Better than BrowseForFolder
# add following 2 dlls to the script directory
# dlls from https://www.nuget.org/packages/Microsoft-WindowsAPICodePack-Shell
# and from https://www.nuget.org/packages/Microsoft-WindowsAPICodePack-Core
# for some mystical reason the script does not run in ISE but console will do
Add-Type -Path "$($PSScriptRoot)\Microsoft.WindowsAPICodePack.Shell.dll"
$dialog = New-Object Microsoft.WindowsAPICodePack.Dialogs.CommonOpenFileDialog
$dialog.IsFolderPicker = $true;
if ($Dialog.ShowDialog() -eq [Microsoft.WindowsAPICodePack.Dialogs.CommonFileDialogResult]::Ok)
{
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<!--<Target Name="GenerateResx" AfterTargets="BeforeBuild">
<Message Text="Check Resources.Designer.cs" Importance="high" />
<Message Text="Generating Designer Files..." />
<GenerateResource Sources="@(EmbeddedResource)" StronglyTypedLanguage="cs" StronglyTypedClassName="%(Filename)" StronglyTypedNamespace="@(EmbeddedResource-&gt;'%(CustomToolNamespace)')" StronglyTypedFileName="@(EmbeddedResource-&gt;'%(RootDir)%(Directory)%(Filename).designer.cs')" PublicClass="true" />
@encap
encap / keyboardLogic.js
Last active August 13, 2021 13:14
The Logic behind virtual keyboard component on CodeRush
computed: {
mistakesHistory() {
return this.history.filter((change) => change.type === 'mistake');
},
mistakes() {
return this.mistakesHistory.reduce((acc, mistake) => {
if (mistake.shift && mistake.expectedText !== ' ') {
if (mistake.text.toLowerCase() === mistake.expectedText
|| (mistake.text.match(/[~!@#$%^&*()_+{}:"|<>?]/)
&& mistake.expectedText.match(/[`1234567890-=[\];'\\,./]/)
@ADeltaX
ADeltaX / FeatureTokenGenerator.cs
Last active March 29, 2024 19:57
Access LimitedAccessFeatures from UWP
//!!!!!!!!!!!!!!
//Thanks to @thebookisclosed for the code. I just rearranged in a way so you can access without having to use the registry
//HINT about compatibility: they CANNOT change feature keys otherwise existing apps would break
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using Windows.ApplicationModel;
@sumitpore
sumitpore / chrome-local-storage-api.js
Last active February 9, 2024 05:19
Chrome's Local StorageArea API in Synchronous way for use in Chrome extensions. Replace 'chrome.storage.local' by 'chrome.storage.sync' if you want to use Sync StorageArea
/**
* Retrieve object from Chrome's Local StorageArea
* @param {string} key
*/
const getObjectFromLocalStorage = async function(key) {
return new Promise((resolve, reject) => {
try {
chrome.storage.local.get(key, function(value) {
resolve(value[key]);
});
@chryzsh
chryzsh / powershell-uac-always-notify-bypass.ps1
Created April 28, 2019 22:06
uac bypass for always notify (works on 1903)
$assemblies=(
"System"
)
$source=@"
using System;
using Microsoft.Win32;
using System.Diagnostics;
namespace Helloworld
@gjp0609
gjp0609 / Translate.js
Last active January 18, 2024 17:35
Tampermonkey script Translate.js
// ==UserScript==
// @name * 搜狗/百度/谷歌翻译
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author OnySakura
// @include *
// @grant GM_xmlhttpRequest
// ==/UserScript==
@BankSecurity
BankSecurity / Simple_Rev_Shell.cs
Last active May 6, 2024 06:24
C# Simple Reverse Shell Code
using System;
using System.Text;
using System.IO;
using System.Diagnostics;
using System.ComponentModel;
using System.Linq;
using System.Net;
using System.Net.Sockets;
@BlaM
BlaM / cookiebanner-go-away.user.js
Last active May 18, 2024 16:55
Get rid of EU Cookie Banners (Tampermonkey)
// ==UserScript==
// @name Get rid of EU Cookie Banners
// @namespace http://blog.deobald.org/
// @description Get rid of EU Cookie Banners
// @license http://creativecommons.org/licenses/by-nc-sa/3.0/
// @downloadURL https://gist.githubusercontent.com/BlaM/6d826d6e9d77d2d77bf9a92fdad55788/raw/cookiebanner-go-away.user.js
// @homepage https://gist.github.com/BlaM/6d826d6e9d77d2d77bf9a92fdad55788
// @version 0.3.4
// @author Dominik Deobald
// @match http*://*/*