Skip to content

Instantly share code, notes, and snippets.

View nickwu241's full-sized avatar
👋

Nick Wu nickwu241

👋
View GitHub Profile
#!/usr/bin/env python
import argparse
import collections
import logging
import os
import re
import subprocess
import time
parser = argparse.ArgumentParser(
FROM ruby:2.5
WORKDIR /app
RUN apt-get update && apt-get install -y build-essential nodejs
COPY Gemfile Gemfile.lock ./
RUN gem install bundler && bundle install
COPY . ./
provider "aws" {
# Make sure AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are exported.
region = "us-east-1"
}
variable "public_key" {
# Generate a SSH key pair if you don't have one.
# To copy your public SSH key: cat ~/.ssh/id_rsa.pub | pbcopy
}
[
{
"quote": "You know you’re in love when you can’t fall asleep because reality is finally better than your dreams.",
"author": "Dr. Suess"
},
{
"quote": "I’m selfish, impatient and a little insecure. I make mistakes, I am out of control and at times hard to handle. But if you can’t handle me at my worst, then you sure as hell don’t deserve me at my best.",
"author": "Marilyn Monroe"
},
{
0 “You know you’re in love when you can’t fall asleep because reality is finally better than your dreams.”-Dr. Suess
1 “I’m selfish, impatient and a little insecure. I make mistakes, I am out of control and at times hard to handle. But if you can’t handle me at my worst, then you sure as hell don’t deserve me at my best.”-Marilyn Monroe
2 “Life is what happens when you’re busy making other plans.” -John Lennon
3 “Get busy living or get busy dying.”-Stephen King
4 “The first step toward success is taken when you refuse to be a captive of the environment in which you first find yourself.”-Mark Caine
5 “When one door of happiness closes, another opens; but often we look so long at the closed door that we do not see the one which has been opened for us.”-Helen Keller
6 “Twenty years from now you will be more disappointed by the things that you didn’t do than by the ones you did do.”-Mark Twain
7 “When I dare to be powerful – to use my strength in the service of my vision, then it becomes less and less important w
#!/usr/bin/env python
import json
import requests
from bs4 import BeautifulSoup
# Fetch the HTML contents from the internet.
URL = 'http://www.keepinspiring.me/famous-quotes/'
response = requests.get(URL)
response.raise_for_status()
#!/usr/bin/env python
import requests
from bs4 import BeautifulSoup
# Fetch the HTML contents from the internet.
URL = 'http://www.keepinspiring.me/famous-quotes/'
response = requests.get(URL)
response.raise_for_status()
html_contents = response.text
#/bin/sh
set -euo pipefail
GIST='nickwu241/83ec4d4d7da0b04eabc2dce678336596'
Copy the output of the Gist HTML to clipboard
curl -s https://gist.github.com/${GIST}.json | jq -r '.div' | pbcopy
# Copy the output of the Gist CSS to clipboard
curl -s $(curl -s https://gist.github.com/${GIST}.json | jq -r '.stylesheet') | pbcopy
@nickwu241
nickwu241 / App.vue
Last active July 9, 2018 05:41
Example Vue Component with statically embedded Gist for blog post for blog post https://medium.com/@nickwu241/embed-a-gist-statically-in-vue-4df59b56b29
<template>
<div>
<h1>Example of a statically embedded Gist</h1>
<!-- Use the Component -->
<Gist />
</div>
</template>
<script>
import Gist from './Gist.vue' // Import the Component
#!/usr/bin/env python
try:
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen
import json
import sys
# Modify COMPONENT_NAME to name your component differently.
COMPONENT_NAME = 'Gist'