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
ipbastola / clean-up-boot-partition-ubuntu.md
Last active Sep 20, 2019
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64
View clean-up-boot-partition-ubuntu.md

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

Reference

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

1. Check the current kernel version

$ uname -r 
@ImJasonH
ImJasonH / markdown.css
Last active Sep 19, 2019
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
View markdown.css
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@arlg
arlg / Good Javascript
Last active Oct 15, 2018
Javascript the good way
View Good Javascript
/*FOR LOOPS
-------------------------------------------*/
//SLOW -> (no caching of the length)
for (var i = 0; i < myArray.length; i++) {}
//GOOD -> (caching the length) : http://jsperf.com/forloops3
for (var i = 0, l = myArray.length; i < l; i++) {}
//BEST -> backwards for loop + caching the length : http://jsperf.com/forward-and-backward-for-loops/2
@DiegoSalazar
DiegoSalazar / validate_credit_card.js
Last active Sep 16, 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.