This file contains 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
var express = require('express') | |
, app = express() | |
, http = require('http') | |
, server = require('http').Server(app) | |
, bodyParser = require('body-parser') | |
, io = require('socket.io')(server); | |
// --------------------------------------------------------------------------- | |
// Configuration | |
// --------------------------------------------------------------------------- |
This file contains 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
# Insert into your .zshrc file | |
# ... | |
POWERLEVEL9K_MODE='awesome-patched' | |
ZSH_THEME="powerlevel9k/powerlevel9k" | |
# ... | |
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="" | |
POWERLEVEL9K_SHORTEN_DIR_LENGTH=0 |
This file contains 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
--- | |
title: "Using Minimal eLearning with Github Gists" | |
author: "Nafeu Nasir" | |
description: "A tutorial on how to create minimal-elearning presentations with Github Gists" | |
date: 2018-6-10 | |
--- | |
# Getting Started | |
First create a brand [new Github Gist](https://gist.github.com/), fill in the description however you'd like, and for the filename, make sure you end with the extension `.memd`. For the document itself, start off by filling it with front-matter like so: |
This file contains 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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
"""Template for python3 terminal scripts. | |
This gist allows you to quickly create a functioning | |
python3 terminal script using argparse and subprocess. | |
""" | |
import argparse |
This file contains 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
$EDITOR `echo $(git diff --name-only HEAD~ HEAD) $(git status --porcelain | awk '{print $2}')` |
This file contains 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
// promisified 'setTimeout' function | |
function delay(delayedFunction, time) { | |
return new Promise((resolve, reject) => { | |
setTimeout(() => { | |
try { | |
resolve(delayedFunction()); | |
} catch (error) { | |
reject(error.message); | |
} | |
}, time); |
This file contains 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
console.log('1 | print immediately'); | |
setTimeout(() => { | |
console.log('2 | print after one second'); | |
}, 1000); |
This file contains 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
console.log('1 | print immediately'); | |
setTimeout(() => { | |
console.log('2 | print after one second'); | |
}, 1000); | |
setTimeout(() => { | |
console.log('3 | print one second after line 2'); | |
}, 2000); |
This file contains 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
console.log('1 | print immediately'); | |
setTimeout(() => { | |
console.log('2 | print after one second'); | |
setTimeout(() => { | |
console.log('3 | print one second after line 2'); | |
}, 1000); | |
}, 1000); |
This file contains 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
function delay(delayedFunction, time) { | |
return new Promise((resolve, reject) => { | |
setTimeout(() => { | |
resolve(delayedFunction()); | |
}, time); | |
}); | |
} |
OlderNewer