Gist simplicity can turn blogging into a liberating experience.
Pros | Cons |
---|---|
✅ Free, simple, fast, hassle-free | ❌ Image upload in comments only |
✅ Tagging | ❌ No post pinning |
✅ Search | ❌ Doesn't look like a blog |
✅ Revisions | ❌ Unfriendly URLs |
/** | |
* Creates a hash for a value using the SHA-256 algorithm. Returns a promise. | |
* | |
* Use crypto.createHash() to create a Hash object with the appropriate | |
* algorithm. | |
* | |
* Use hash.update() to add the data from val to the Hash, hash.digest() to | |
* calculate the digest of the data. | |
* | |
* Use setTimeout() to prevent blocking on a long operation. Return a Promise to |
function fizzBuzz(n: number) { | |
return ( | |
{ true: '', false: 'Fizz' }[`${n % 3 === 0}`] + | |
{ true: '', false: 'Buzz' }[`${n % 5 === 0}`] || | |
n.toString() | |
) | |
} | |
function fizzBuzzFunctional(n: number) { | |
let test = |
/** | |
* Workaround to set up a handshake, lazy-loading by resolving a promise | |
*/ | |
let settleReadyState = {} | |
let subprocess = {} | |
// following code outputs: Promise {<pending>} on console and sets | |
// settleReadyState = { resolve: ƒ, reject: ƒ} | |
// subprocess = {ready: Promise<pending>} |
/** | |
* fibonacciGenerator.js | |
* tags: { JavaScript, Generator, Iterator } | |
*/ | |
function* fibonacciGenerator() { | |
var [prev, curr] = [0, 1] | |
while(true) { | |
[prev, curr] = [curr, prev + curr] | |
yield curr |
@echo off | |
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe | |
rem add it for all file types | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f | |
rem add it for folders | |
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f |
#!/bin/bash | |
# Sometimes you need to move your existing git repository | |
# to a new remote repository (/new remote origin). | |
# Here are a simple and quick steps that does exactly this. | |
# | |
# Let's assume we call "old repo" the repository you wish | |
# to move, and "new repo" the one you wish to move to. | |
# | |
### Step 1. Make sure you have a local copy of all "old repo" | |
### branches and tags. |
/* Return tuple types, with a nullable error component just like Go */ | |
/* meta: Typescript 3.9.5 */ | |
type Err = Error | null; | |
async function getUser(): Promise<[string, Err]> { | |
try { | |
const res = await fetch('/me'); | |
const data = await res.json(); | |
/** | |
* getNumberOfDigits.js | |
* tags: { JavaScript, Array, RxJS } | |
*/ | |
const { interval } = Rx; | |
const { scan, pluck, groupBy } = RxOperators; | |
interval(1000).pipe( | |
scan( |
echo-server-epoll | |
echo-server-poll | |
talk | |
talk.dSYM |