This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo dd bs=4M if=~/Downloads/Fedora-KDE-Live-x86_64-28-1.1.iso of=/dev/sdb status=progress conv=fdatasync | |
#Get Usb drive name by issuing the following command | |
#fdisk -l | |
#http://www.webupd8.org/2014/04/prevent-your-laptop-from-overheating.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node { | |
constructor(data) { | |
this.data = data; | |
this.count = 1; | |
this.left = null; | |
this.right = null; | |
this.inorderOut = []; | |
this.preorderOut = []; | |
this.postorderOut = []; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node { | |
constructor(data) { | |
this.data = data; | |
this.left = null; | |
this.right = null; | |
this.inorderOut = []; | |
this.preorderOut = []; | |
this.postorderOut = []; | |
} | |
insert(data) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.strstr = function(needle) { | |
const haystack = this; | |
if(!needle) return [0]; | |
if(!haystack || needle.length > haystack.length) return [-1]; | |
let i,j; | |
let positions = []; | |
for(i=0;i<haystack.length;i++) { | |
let index = i; | |
j=0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JavaScript (ES6) port of the code at https://gist.github.com/bhelx/778542 | |
// Also handles leading 0's in strings | |
const BASE = 62; | |
const UPPERCASE_OFFSET = 55; | |
const LOWERCASE_OFFSET = 61; | |
const DIGIT_OFFSET = 48; | |
class Base62{ | |
constructor() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Fastest way to copy a Collection in MongoDB | |
db.getCollection('OriginalCollection').aggregate([ { $out: "ClonedCollection" } ]); |
NewerOlder