Skip to content

Instantly share code, notes, and snippets.

View shgysk8zer0's full-sized avatar
💭
I may be slow to respond.

Chris Zuber shgysk8zer0

💭
I may be slow to respond.
View GitHub Profile
@shgysk8zer0
shgysk8zer0 / linkfilter.js
Created March 15, 2016 00:27
Quickly get info from <link>s,filtering unwanted `rel`s
function $(query) {
return Array.from(document.querySelectorAll(query));
}
$('link').filter(link = > ![
'icon',
'stylesheet',
'next',
'prev'
].some(rel => link.relList.contains(rel))).reduce((links, link) => {
@shgysk8zer0
shgysk8zer0 / cc-validate.js
Created March 21, 2016 00:34
Validates a 16 digit credit card number
/**
* Validates a 16 digit credit card number
*
* @param string ccnum Any 16 digit number as a string
* @return boolean Whether or not it Validates
*/
function checkCCNum(ccnum) {
if (ccnum.length !== 16 || ! /^\d+$/.test(ccnum)) {
return false;
}

Keybase proof

I hereby claim:

  • I am shgysk8zer0 on github.
  • I am shgysk8zer0 (https://keybase.io/shgysk8zer0) on keybase.
  • I have a public key whose fingerprint is C885 8E4F 4633 F3E5 F364 B25A 5399 86BB 2E23 D409

To claim this, I am signing this object:

@shgysk8zer0
shgysk8zer0 / clipcrypt
Last active March 28, 2020 19:03
Bash script to decrypt data from clipboard
#!/bin/bash
# Save this script to anywhere in `$PATH`, but ideally as `/usr/local/bin/clipcrypt`
# Grant read/execute permissions `chmod 755 /usr/local/bin/clipcrypt`
# Optionally, make root the owner `sudo chown root:root /usr/local/bin/clipcrypt`
xclip -selection clipboard -o | gpg -d | xclip -selection clipboard
@shgysk8zer0
shgysk8zer0 / index.php
Last active September 8, 2020 14:49
RSA public key cryptography using PHP >= 7
<?php
//namespace shgysk8zer0\PHPCrypt;
const PUBLIC_KEY = './pub.pem';
const PRIVATE_KEY = './priv.pem';
const PUB2 = './pub2.pem';
const PRIV2 = './priv2.pem';
const PASSWORD = 'dgbdkfjg';
const PASSWORD2 = 'dfgnduyho';
@shgysk8zer0
shgysk8zer0 / README.md
Created February 10, 2017 06:28
Generate random images in PHP

Generate random images in PHP

sample

Why?

  • Because you can
  • Because you have time to spare
  • Maybe you think they look cool or want to save them for wallpapers or something
  • Maybe it reminds you of that one time... You know which time I'm talking about

Requirements

@shgysk8zer0
shgysk8zer0 / squares-sum.mml
Last active April 21, 2017 15:15
Squares as sum proof
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<semantics>
<mtable>
<mtr>
<mtd>
<mrow>
<mi>x</mi>
<mo stretchy="false">∈</mo>
<mi mathvariant="normal">ℕ</mi>
</mrow>
@shgysk8zer0
shgysk8zer0 / index.html
Last active September 12, 2018 04:52
Share API shim
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Share API Shim Demo</title>
<script type="aplication/javascript" src="/path/to/dialog-shim.js"></script>
<script type="module" src="index.js" async=""></script>
<script type="application/javascript" async="" nomodule=""></script>
</head>
<body>
@shgysk8zer0
shgysk8zer0 / .editorconfig
Last active February 5, 2019 23:54
Signature Canvas
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
@shgysk8zer0
shgysk8zer0 / daily-css-images-09-calendar.markdown
Created November 12, 2019 16:57
Daily CSS Images | 09 | Calendar