Skip to content

Instantly share code, notes, and snippets.

View spences10's full-sized avatar
πŸ’­
SvelteKit is bae!

Scott Spence spences10

πŸ’­
SvelteKit is bae!
View GitHub Profile
// Creating promises
var promise = new Promise(function (resolve, reject) {
resolve('all good')
})
promise.then(function (result) {
console.log('was it good?', result)
}).catch(function (err) {
console.error('ERR', err)
})
@micahgodbolt
micahgodbolt / wsl_install_node.md
Last active December 22, 2022 09:37
WSL install Node

The apt-get version of node is incredibly old, and installing a new copy is a bit of a runaround.

So here's how you can use NVM to quickly get a fresh copy of Node on your new Bash on Windows install

$ touch ~/.bashrc
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
// restart bash
$ nvm install --lts
@spences10
spences10 / github-cheat-sheet.md
Last active November 18, 2024 21:37
GitHub Cheat Sheet

Useful Git commands

This is just stuff that I have put down that I find I use a lot of the time for my own reference.

Latest changes from repo to your machine

$ git pull
@fabianvf
fabianvf / oreilly_downloader.py
Last active February 26, 2020 13:42
Downloads Oreilly free ebooks by category. Requires requests library and python 2. Categories I've see so far are business, data, iot, security, web-platform, webops-perf, programming, so usage would look like: python oreilly_downloader.py business data iot security web-platform webops-perf programming
import os
import re
import sys
import requests
filename_matcher = re.compile(r'http://www.oreilly.com/(.*)/free/(.*).csp')
def main():
categories = sys.argv[1:]
urls = map(lambda x: 'http://www.oreilly.com/{}/free/'.format(x), categories)
@Danib17
Danib17 / .json
Last active December 21, 2016 10:54
Quotes
[
{
"quoteID": 1,
"quote": "Efforts and courage are not enough without purpose and direction.",
"author": "John F Kennedy",
"description": "35th President of the USA",
"profile": "http://markmcmillion.com/wp-content/uploads/2014/03/JFK-150x150.jpg",
"portrait": "http://bit.ly/1Q6aObg",
"bio": "John F Kennedy was a president of the United States of America"
},
@matkl
matkl / gist:413db1a282f5622607c8c4e08fca3673
Created July 2, 2016 00:07
Delete ALL node_modules recursively
npm install -g rimraf
find . -name "node_modules" -exec rimraf {} \;
@tomysmile
tomysmile / setup-vagrant-macosx.md
Created April 26, 2016 05:54
How to Install Virtualbox and Vagrant on MacOSX

Install Virtualbox && Vagrant for MacOSX

Vagrant uses Virtualbox to manage the virtual dependencies. You can directly download virtualbox and install or use homebrew for it.

$ brew cask install virtualbox

Now install Vagrant either from the website or use homebrew for installing it.

# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed

From zero to microservice with 𝚫 now

The following guide will show you how to deploy a simple microservice written in JavaScript using 𝚫 now.

It uses Open Source tools that are widely available, tested and understood:

  • Node.JS
  • NPM
  • Express
@pdewouters
pdewouters / quotes.json
Created October 14, 2015 09:37
Quotes
[
{
"property1": "A quote by Hunter S. Thompson, 1937 - 2005",
"property2": "Whatever else might be said about Nixon β€” and there is still serious doubt in my mind that he could pass for human β€” he is a goddamned stone fanatic on every aspect of pro football.\nHunter S. Thompson",
"index": 1,
"url": "http://www.qotd.org/search/single.html?qid=1"
},
{
"property1": "A quote by Anonymous",
"index": 2,