Skip to content

Instantly share code, notes, and snippets.

View joshteng's full-sized avatar

Joshua Teng joshteng

View GitHub Profile
#!/bin/sh
#
# This script should be run via curl:
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# or via wget:
# sh -c "$(wget -qO- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# or via fetch:
# sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
#
# As an alternative, you can first download the install script and run it afterwards:
_xamzrequire=function(){function e(t,r,n){function i(s,a){if(!r[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[s]={exports:{}};t[s][0].call(l.exports,function(e){return i(t[s][1][e]||e)},l,l.exports,e,t,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)i(n[s]);return i}return e}()({115:[function(e,t,r){(function(r){(function(){var n=e("../core"),i=e("../region_config"),o={isArnInParam:function(e,t){var r=(e.service.api.operations[e.operation]||{}).input||{},i=r.members||{};return!(!e.params[t]||!i[t])&&n.util.ARN.validate(e.params[t])},validateArnService:function(e){var t=e._parsedArn;if("s3"!==t.service&&"s3-outposts"!==t.service&&"s3-object-lambda"!==t.service)throw n.util.error(new Error,{code:"InvalidARN",message:"expect 's3' or 's3-outposts' or 's3-object-lambda' in ARN service component"})},validateArnAccount:function(e){if(!
{
"name": "Josh"
}
@joshteng
joshteng / app.py
Created March 30, 2020 10:02 — forked from seanbehan/app.py
Flask with Django ORM
'''
Run the following commands (bc. gists don't allow directories)
pip install flask django dj-database-url psycopg2
mkdir -p app/migrations
touch app/__init__.py app/migrations/__init__.py
mv models.py app/
python manage.py makemigrations
python manage.py migrate
@joshteng
joshteng / server.md
Last active April 5, 2020 12:52
server setup

Provision a Server and Access via SSH

Installing Essentials

sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libbz2-dev libsqlite3-dev wget git
git config --global user.name ""
const property = { first: "Wes", last: "Side", address: { lines: ["first line", "second line"], city: "New York", state: "NY" }}

//to get the second line
const { address: { lines: [ , line2] } } = property
@joshteng
joshteng / html_timer.html
Created March 5, 2017 09:12
Simple HTML Timer to Demonstrate Javascript on a Browser
<html>
<head>
<style>
p#secondsLeft {
padding-top: 100px;
text-align: center;
font-size: 50px;
}
p.secondsLeftText {

NEXT Academy Company Trip (Dec 2016)

##3 Epic Days of Sheer Fun and Lifetime Worthy Experience at Langkawi

"The best cameras are useless if no great photos are ever taken with it. Just like life, we should always strive for excellence and, at the same time, craft amazing experiences with only some people around us." - Josh

Dino3.jpg

<--Call to Action here-->

@joshteng
joshteng / Sendy.md
Last active February 1, 2016 17:33 — forked from dovy/Sendy.md

Sendy

Sendy is a self hosted email newsletter application that lets you send trackable emails via Amazon Simple Email Service (SES).

Heroku

You can deploy Sendy on Heroku using the following instructions (I assume you've already installed the heroku toolbelt).

  1. Download Sendy
  2. Navigate into the folder where Sendy is and initialize it as a Git repo git init
// While you can edit this file, it's best to put your changes in
// "User/Preferences.sublime-settings", which overrides the settings in here.
//
// Settings may also be placed in file type specific options files, for
// example, in Packages/Python/Python.sublime-settings for python files.
{
// Sets the colors used within the text area
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
// Note that the font_face and font_size are overriden in the platform