Skip to content

Instantly share code, notes, and snippets.

Joshua Teng joshteng

  • San Francisco
Block or report user

Report or block joshteng

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Complex Destructuring.md
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 Mar 5, 2017
Simple HTML Timer to Demonstrate Javascript on a Browser
View html_timer.html
<html>
<head>
<style>
p#secondsLeft {
padding-top: 100px;
text-align: center;
font-size: 50px;
}
p.secondsLeftText {
View NEXT Academy Company Trip (Dec 2016).md

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-->

View 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
View Default-Preferences.sublime-settings
// 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
@joshteng
joshteng / dokku_setup.md
Last active May 15, 2019
Using Dokku to deploy a Rails Application
View dokku_setup.md

#Goal Deploy your Rails App super easily with Dokku on Digital Ocean cheap cheap!

##Notes

  • Follow 12 factor design (include the rails_12factor gem)
  • Don't forget your Procfile with the command to start up your application server
  • I prefer using external hosted logging services like Logentries (not in this guide)
  • Set up performance monitoring AppSignal or New Relic (not in this guide)
View ubuntu_setup.md

#Setting Up a Ubuntu Machine

####Step 1 Install all dependencies using Laptop by Thoughtbot

bash <(wget -qO- https://raw.githubusercontent.com/thoughtbot/laptop/master/linux) 2>&1 | tee ~/laptop.log

####Step 2 Restart computer

View Using_Vagrant.markdown

Download and Install Vagrant http://www.vagrantup.com/ and VirtualBox https://www.virtualbox.org/ or VMware before beginning

#Set up Vagrant *this guide assumes the use of Mac OS X Mountain Lion on local machine and Ubuntu 12.04 LTS x64 on Vagrant box. It is compatible with many other distros but hasn't been tested.

##Step 1: Make and run box

vagrant init
vagrant box add <path to box directory or name according to https://vagrantcloud.com/>
vagrant up
@joshteng
joshteng / Deploying_rails_app.markdown
Last active Aug 29, 2015
Manual Server Set Up + Deploy With Capistrano (not working yet)
View Deploying_rails_app.markdown
@joshteng
joshteng / psql_encoding.markdown
Last active Aug 8, 2018 — forked from turboladen/psql_encoding.sql
This solves Postgresql's encoding issue (happened to me when running postgres on my vagrant box) The error happens when trying to create db "rake db:create": Error message: "encoding UTF8 does not match locale en_US; the chosen LC_CTYPE setting requires encoding LATIN1"
View psql_encoding.markdown
sudo su postgres
psql
update pg_database set datistemplate=false where datname='template1';
drop database Template1;
create database template1 with owner=postgres encoding='UTF-8' lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
update pg_database set datistemplate=true where datname='template1';
You can’t perform that action at this time.