Skip to content

Instantly share code, notes, and snippets.

View NguyenDa18's full-sized avatar
🎧
Listening to Funny Podcasts

Danh Nguyen NguyenDa18

🎧
Listening to Funny Podcasts
View GitHub Profile
@NguyenDa18
NguyenDa18 / typescript_101.md
Last active May 22, 2018 23:57
TypeScript Basics

TypeScript 101 - From Dylan Israel (CodeTutorials360)

Getting started

  • Run npm i -g typescripton terminal

  • Create a new TypeScript file: .ts

  • Run tsc <file>.ts to get the compiled javascript version of code

  • Use the annotation: '@ts-check' to have the javascript file be checked like TypeScript

Examples: Primary types

@NguyenDa18
NguyenDa18 / barcode_detection.py
Created May 24, 2018 20:22
Refactored Python Barcode Reader
# USAGE
# python detect_barcode.py --image images/barcode_<num>.jpg
# import the necessary packages
import numpy as np
import argparse
import cv2
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
@NguyenDa18
NguyenDa18 / ml4all.md
Last active May 29, 2018 23:14
ML4ALL Day 1

Document of talks at ML4ALL

Machine Learning Can Increase Health Insurance Enrollments - Ricky Hennesssy

Obamacare

  • Make affordable health insurance available
  • Expand Medicaid to cover low income adults
  • Support Medicare delivery methods designed to lower costs
  • Important provisions and solutions
  1. Insurance Mandates
@NguyenDa18
NguyenDa18 / clojure-ref.md
Last active July 3, 2018 22:32
Clojure Crash Course

Clojure Basics Tutorial - Learning for Cambia ADIF Team

Package file into JAR with Leinengen

  • lein uberjar
  • Execute with: java -jar target/uberjar/<your-code.jar>

Clojure recognizes two kinds of structures:

  1. Literal representations of data structs
  2. Operations
@NguyenDa18
NguyenDa18 / ng-component.md
Last active July 11, 2018 20:55
Angular Component Cheatsheet

Make Angular Component Manually

  1. new [component].ts
import { Component } from '@angular/core'

@Component({
  selector: 'app-[component]',
  templateUrl: 'app-[mycomponent].html',
 styleUrls: []
@NguyenDa18
NguyenDa18 / ng-service.md
Created July 11, 2018 21:02
Angular Service Manually Generate

Create Service in Angular Manually

  1. Create services/[data].service.ts
import { Injectable } from '@angular/core';

@Injectable()
export class [myData]Service {
  constructor() { }
}
@NguyenDa18
NguyenDa18 / mocha-talk.md
Created July 18, 2018 18:51
Testing Node.js with Mocha

TLDW: Testing NodeJS w/ Mocha

Fundamentals:

  • 6:00: Assertions -comparisons which throw exception upon failure
const assert = value => if (!value) throw new Error('assertion failure!')
  • 6:54: Unit Test -asserts "unit" behaves as intended, "unit" typically a function
@NguyenDa18
NguyenDa18 / cloud9-tips.md
Created July 21, 2018 19:24
QuickStart Cloud9

Cloud9 Quickstart

Reminder: Node is outdated

  • nvm install stable : update to latest Node

Working Angular

  • npm i -g @angular/cli
  • cd app folder
  • ng serve --host 0.0.0.0 --port 8080 --disableHostCheck
  • Preview app
@NguyenDa18
NguyenDa18 / shop-deploy.md
Created July 24, 2018 02:10
Shopping App Deployment
@NguyenDa18
NguyenDa18 / lightning-talk.md
Last active December 25, 2018 08:15
PdxNode Resources

Learning Resources: Web Dev, APIs, DevOps, Machine Learning

Web Learning Resources