Skip to content

Instantly share code, notes, and snippets.

View vickean's full-sized avatar

Victor Kean vickean

  • Petaling Jaya, Selangor, Malaysia
View GitHub Profile
@vickean
vickean / 20210108030637-add_apiKey_to_providers.js
Created January 8, 2021 04:34
Migration to add apiKey field
"use strict";
module.exports = {
up: async (queryInterface, Sequelize) => {
/**
* Add altering commands here.
*
* Example:
* await queryInterface.createTable('users', { id: Sequelize.INTEGER });
*/

Hi! I'm Victor.

I love coming up and playing with ideas. Especially those that can be built using Javascript and shared with everyone!

I've been coding full-time since October 2019 and am still very much a newbie to the web dev community.

If you have a fun project that you're working on or know of that you think might be useful for a new dev like me to take a look at just tweet me at @vickean!

This github account is a journal that documents my journey from barely being able to code a simple site to being able to build frontends using ReactJS and backends using NodeJS.

#1. Count the votes for Sen. Olympia Snowe, whose id is 524.
SELECT COUNT(*) FROM votes WHERE politician_id = 524 ;
#2. Now do that query with a JOIN statement without hard-coding the id 524 explicitly, querying both the votes and congress_members table.
SELECT COUNT(*) FROM congress_members INNER JOIN votes ON congress_members.id = votes.politician_id WHERE congress_members.name = "Sen. Olympia Snowe" ;
#3. How about Rep. Erik Paulsen? How many votes did he get?
SELECT COUNT(*) FROM congress_members INNER JOIN votes ON congress_members.id = votes.politician_id WHERE congress_members.name = "Rep. Erik Paulsen" ;
#4. Make a list of Congress members that got the most votes, in descending order. Exclude the create_at and updated_at columns.
require 'Benchmark'
class Sudoku
attr_accessor :puzzle
def initialize
@puzzle = ''
@game = Array.new(9)
@game.map! { Array.new(9) }
9.times do |i|