Skip to content

Instantly share code, notes, and snippets.

@WolffDev
WolffDev / main.dart
Created January 3, 2022 17:18
Streams with click
import 'dart:html';
void main() {
final ButtonElement button = querySelector('button') as ButtonElement;
button.onClick
.timeout(
Duration(seconds: 1),
onTimeout: (sink) => sink.addError("You have lost")
).listen(
@WolffDev
WolffDev / asymmetric-encryption.js
Last active December 25, 2019 00:15
Asymmetric encryption
var crypto = require("crypto");
var path = require("path");
var fs = require("fs");
const { PerformanceObserver, performance} = require('perf_hooks');
const passphrase = "mySecret"
var encryptStringWithRsaPublicKey = function(toEncrypt, relativeOrAbsolutePathToPublicKey) {
var absolutePath = path.resolve(relativeOrAbsolutePathToPublicKey);
var publicKey = fs.readFileSync(absolutePath, "utf8");
# http://www.webupd8.org/2015/12/how-to-change-mouse-scroll-wheel-speed.html
sudo apt-get install imwheel
nano ~/.imwheelrc
# in .imwheelrc file, paste
".*"
None, Up, Button4, 3
None, Down, Button5, 3
var bgp = chrome.extension.getBackgroundPage();
bgp.console.log("calling bg page console log from popup.js");
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
/script SetCVar("nameplateMaxDistance", 80)
function npm_install {
if [ -f yarn.lock ]; then
yarn install $@
else
npm install $@
fi
touch ./node_modules/.metadata_never_index
}
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\033[32m\]\w \[\033[00m\]\e[31m\$(parse_git_branch)\e[0m \n$ "