Skip to content

Instantly share code, notes, and snippets.

View vincentntang's full-sized avatar
💭
¯\_(ツ)_/¯

Vincent Tang vincentntang

💭
¯\_(ツ)_/¯
View GitHub Profile
@vincentntang
vincentntang / keybase.md
Created December 9, 2019 17:41
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 September 10, 2019 20:59
Example of a graphql setup (Resolver - handles functions, query requests data, graphql.json is the return, schema.graphql is what you can traverse
{
"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 17:43
Oh-My-Zsh enabling "code ." to work on MacOS with anaconda3
# 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 April 13, 2019 15:12
hackerrank diagnol difference
"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 April 7, 2019 15:30
MongoDB Slack : POST vs AUTHORS one-to-many
// 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
],
// mocked data from swagger
export const tagsData = {
"questions": [
{
"tags": [
{
"_id": "asdfasdfsadf1",
"name": "first"
},
{
@vincentntang
vincentntang / file-issues-pt2-bear.sh
Created January 24, 2019 03:50
this was after fetching and merging commits off master branch,commit 42
➜ 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]
@vincentntang
vincentntang / file-issues-install.sh
Last active January 23, 2019 04:58
issues with install
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 December 24, 2018 14:11
amazon canvas demo refactor
// 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");
var canvas = document.querySelector("canvas");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
canvas.width = 1600;
canvas.height = 800;
var ctx = canvas.getContext("2d");