Skip to content

Instantly share code, notes, and snippets.

From zero to hero

Peter Širka petersirka

From zero to hero
Block or report user

Report or block petersirka

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ipbastola /
Last active Nov 19, 2019
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64


Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
ImJasonH / markdown.css
Last active Oct 19, 2019
Render Markdown as unrendered Markdown (see
View markdown.css
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
arlg / Good Javascript
Last active Oct 15, 2018
Javascript the good way
View Good Javascript
//SLOW -> (no caching of the length)
for (var i = 0; i < myArray.length; i++) {}
//GOOD -> (caching the length) :
for (var i = 0, l = myArray.length; i < l; i++) {}
//BEST -> backwards for loop + caching the length :
DiegoSalazar / validate_credit_card.js
Last active Nov 19, 2019
Luhn algorithm in Javascript. Check valid credit card numbers
View validate_credit_card.js
// Takes a credit card string value and returns true on valid number
function valid_credit_card(value) {
// Accept only digits, dashes or spaces
if (/[^0-9-\s]+/.test(value)) return false;
// The Luhn Algorithm. It's so pretty.
let nCheck = 0, bEven = false;
value = value.replace(/\D/g, "");
for (var n = value.length - 1; n >= 0; n--) {
You can’t perform that action at this time.