sudo apt-get install <pkg name>
install packagesudo apt-get remove <pkg name>
remove packageapt list | grep <txt to search>
search currently installed packagesxkill
kill an unresponsive window w. mousetouch
to create file,mkdir
to create dirrm
to delete file,rmdir
to delete dir
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
const QueryParams = {}; | |
QueryParams.options = { | |
usePlusSigns: false, // per RFC 1866 application/x-www-form-urlencoded; otherwise use "%20" for space | |
keyMustReturnArray: key => key.endsWith('_arr') // for URI-decoded keys that return `true` for this function, coerce the value to an array even if it contains no commas | |
}; | |
const decode = str => { | |
if (QueryParams.options.usePlusSigns) { | |
str = str.replace(/\+/g, '%20'); |
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
/* | |
Concepts covered: | |
concept | syntax | |
---------------------------------|-------------------------- | |
testing for a match | test | |
replacing matches | replace | |
...with a string | replace(re, '...') | |
...with a function | replace(re, m => ...) |
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
const alphabetMap = { | |
a: 'a@4', b: 'b8', c: 'c{\\[(', d: 'd', e: 'e3', f: 'f', g: 'g69', h: 'h', | |
i: 'i|', j: 'j', k: 'k', l: 'l', m: 'm', n: 'n', o: 'o0', p: 'p', q: 'q', | |
r: 'r', s: 's5', t: 't7', u: 'u', v: 'v', w: 'w', x: 'x', y: 'y', z: 'z2' | |
}; | |
const makeRegex = str => { | |
const inner = str.split('').map(char => { | |
const chars = alphabetMap[char]; |
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
const insaneOptions = { | |
allowedAttributes: { | |
a: ['href', 'name', 'target', 'rel', 'title'], | |
img: ['src', 'alt', 'title'], | |
input: ['type', 'checked', 'disabled'], | |
code: ['class'], | |
span: ['class'], | |
th: ['align'], | |
tr: ['align'] | |
}, |
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
/* | |
source: https://github.com/zeit/now-examples/blob/3f609858904e7dafbd016a255de325a936cf240f/nextjs-news/lib/get-stories.js | |
The actual functionality isn't anything special - it just gets data about news | |
stories for a typical hacker-news-clone demo app. | |
What I like is how this really short snippet shows off so many really nice | |
features of modern JavaScript. This is the snippet I'd show to rebut someone | |
claiming "JavaScript is a poorly-designed language created by Brendan Eich in | |
10 days". |
- Video: Harvard CS50 - Hardware - Understanding Technology | 1 hour
- Video: Veritasium - How Does a Transistor Work? | 6 minutes
- Course: Stanford CS101 - SELF PACED Computer Science 101 | 4 hours + exercises
- Course: Udemy - Introduction to Cloud Computing | 1 hour + quiz
NewerOlder