Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
¯\_(ツ)_/¯

Vincent Tang vincentntang

💭
¯\_(ツ)_/¯
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am vincentntang on github.
  • I am vincentntang (https://keybase.io/vincentntang) on keybase.
  • I have a public key whose fingerprint is 0D29 B65E 9CD1 DB1A 4C2A FF16 3A26 F7A0 DC2F B0BA

To claim this, I am signing this object:

@vincentntang
vincentntang / graphql.json
Last active Sep 10, 2019
Example of a graphql setup (Resolver - handles functions, query requests data, graphql.json is the return, schema.graphql is what you can traverse
View graphql.json
{
"data": {
"jobs": [
{
"id": "rJKAbDd_z",
"title": "Frontend Developer",
"company": {
"id": "HJRa-DOuG",
"name": "Facegle",
"description": "We are a startup on a mission to disrupt social search engines. Think Facebook meet Google."
@vincentntang
vincentntang / .bashrc
Created May 29, 2019
Oh-My-Zsh enabling "code ." to work on MacOS with anaconda3
View .bashrc
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}
if [ -f ~/.bash_profile ]; then
. ~/.bash_profile
fi
@vincentntang
vincentntang / diagnol-difference.js
Created Apr 13, 2019
hackerrank diagnol difference
View diagnol-difference.js
"use strict";
const fs = require("fs");
process.stdin.resume();
process.stdin.setEncoding("utf-8");
let inputString = "";
let currentLine = 0;
@vincentntang
vincentntang / many-to-many.js
Last active Apr 7, 2019
MongoDB Slack : POST vs AUTHORS one-to-many
View many-to-many.js
// A post can have multiple authors
// An author can have many posts
// many-to-many relationship
{
Post: [
postID: 'postID',
postTitle: 'How to build a website'
postContent: '<div><p>HTML or markdown content here<p></div>'
authorID: ['AuthorID1','AuthorID2'] // We define many-to-many relationship here
],
View mocked-data-bears.js
// mocked data from swagger
export const tagsData = {
"questions": [
{
"tags": [
{
"_id": "asdfasdfsadf1",
"name": "first"
},
{
@vincentntang
vincentntang / file-issues-pt2-bear.sh
Created Jan 24, 2019
this was after fetching and merging commits off master branch,commit 42
View file-issues-pt2-bear.sh
➜ Bears-Team-22 git:(master) npm run start
> knowledge@0.0.0 start /Users/vincenttang/www/Bears-Team-22
> concurrently npm:start:*
[start:client]
[start:client] > knowledge@0.0.0 start:client /Users/vincenttang/www/Bears-Team-22
[start:client] > cd client && npm run build && npm start
[start:client]
[start:server]
View file-issues-install.sh
Bears-Team-22 git:(master) npm start
> knowledge@0.0.0 start /Users/vincenttang/www/Bears-Team-22
> concurrently npm:start:*
[start:server]
[start:server] > knowledge@0.0.0 start:server /Users/vincenttang/www/Bears-Team-22
[start:server] > cd server && docker-compose up
[start:server]
[start:client]
@vincentntang
vincentntang / snowflake.js
Created Dec 24, 2018
amazon canvas demo refactor
View snowflake.js
// Create a canvas element of the specified size.
const canvasWidth = 1000,
canvasHeight = 100,
canvas = document.querySelector("canvas");
canvas.width = canvasWidth;
canvas.height = canvasHeight;
const snowflake = canvas.getContext("2d");
View Canvas-Version2.js
var canvas = document.querySelector("canvas");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
canvas.width = 1600;
canvas.height = 800;
var ctx = canvas.getContext("2d");
You can’t perform that action at this time.