Skip to content

Instantly share code, notes, and snippets.

View wontwon's full-sized avatar

Tuan Duong wontwon

View GitHub Profile
const fetch = require("node-fetch");
import { GraphQLClient } from "graphql-request";
const { customAlphabet } = require("nanoid");
import { CREATE_GREETING_MUTATION, GET_USER_QUERY } from "../Queries";
const alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv";
const sgMail = require("@sendgrid/mail");
{id: 10, createdBy: {id: 50}, dateCreated: "2017-10-26T14:08:33Z", lastUpdated: "2017-10-26T14:08:33Z",…}
changeVersion
:
0
copyChildrenIds
:
null
copyParent
:
null
def crazy_nums(max)
less_than_max_num_array = []
(0..(max-1)).each do |i|
less_than_max_num_array.push(i)
end
divisible_numbers = []
less_than_max_num_array.each do |i|
if((i % 3 === 0) || (i % 5 === 0)) #AND ARE divisible by either three or five
if((i % 5 === 0) && (i % 3 === 0)) #BUT ARE NOT divisible by _both_ three and five
@wontwon
wontwon / harr.rb
Created April 21, 2016 08:45
Check it
def check_less_than_max_nums(max)
less_than_max_num_array = []
(0..(max-1)).each do |i|
less_than_max_num_array.push(i)
end
return less_than_max_num_array
end
def check_divisible_by_three_five (numbers)
import React from 'react';
import ChatLine from './chat-line';
const ChatLog = React.createClass({
getInitialState: function() {
console.log('initial state');
return { lines: [] };
},
addMessage: function(msg) {
@wontwon
wontwon / dotfile
Created April 20, 2015 18:05
dotdotdot
# Quicker navigation
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
# Shortcuts to my Code folder in my home directory
alias code="cd ~/Code"
alias sites="cd ~/Code/sites"
@wontwon
wontwon / jquery_example.html
Last active August 29, 2015 13:58 — forked from dbc-challenges/jquery_example.html
Intro to jQuery for Phase 0
<!DOCTYPE html>
<html>
<head>
<title>DOM manipulation with jQuery</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="gps.js"></script>
</head>
@wontwon
wontwon / gps.html
Last active August 29, 2015 13:57
GPS 3
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<style>
body{
background: #ffffff;
color: #000080;
}
a{
color: #800080;
@wontwon
wontwon / 0.2.1-boggle_class_from_methods.rb
Last active August 29, 2015 13:56 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
phase 0 unit 2 week 1boggle class challenge
class BoggleBoard
def initialize(dice_grid)
@dice_grid = dice_grid
end
def create_word (*coords)
coords.map { |coord| @dice_grid[coord.first][coord.last]}.join("")
end