Skip to content

Instantly share code, notes, and snippets.

View imaginate's full-sized avatar

Adam Smith imaginate

  • San Jose, CA
View GitHub Profile
@imaginate
imaginate / portfolio.md
Last active October 10, 2022 05:21
Portfolio Of Open-Sourced Work For Adam Smith

Adam Smith's Open-Sourced Portfolio

  • Motion
    A bicycle rental web application I created to demostrate some basic front-end skills. It uses React, Node.js, Sass, Handlebars, and more. Note that it is a work in progress, but is far enough along to exemplify some abilities.

  • Cedge
    A set of critical data structures missing from JavaScript's standard library that I use for competitive programming and decided in June 2022 to open-source for others to use for whatever needs they have.

  • Algorithm IV Question Manager
    A web application that I developed to help others learn computer science and to practice for interviews. To view the application clone or download the source and open example/view-example.html in your browser via the file:// protocol. While Algorithm IV's website was up I hosted thousands of guests. A relaunch is pla

@imaginate
imaginate / remove-block.js
Created May 25, 2022 00:10
Remove Glassdoor "Add Your Review Or Salary To Continue" Block (Paste JS Into Console)
(function($){
$.querySelector('#ContentWallHardsell').remove();
$.querySelector('body').style.overflow = 'scroll';
const style = $.createElement('style');
style.innerHTML = '#LoginModal{display:none!important}';
$.head.appendChild(style);
window.addEventListener('scroll',e => e.stopPropagation(),true);
})(document);
@imaginate
imaginate / solution.kt
Created May 23, 2022 23:21
Leetcode 2281. Sum of Total Strength of Wizards - 8th Place Solution
import java.util.*
const val MOD = 1000000007L
class Solution {
fun totalStrength(strength: IntArray): Int {
val n = strength.size
val left = IntArray(n) { -1 }
val right = IntArray(n) { -1 }
val stack = Stack<Int>()
@imaginate
imaginate / solution.cpp
Last active May 23, 2022 23:17
Leetcode 2281. Sum of Total Strength of Wizards - 1st Place Solution
class Solution
{
public:
int totalStrength(vector<int>& a)
{
int n = a.size();
const long long MOD = 1000000007;
vector<long long> b(n + 1);
for (int i = 0; i < n; ++i) {
var is = Array.isArray;
var print = function print(func) {
var str;
var key;
str = '[' + typeof func + ']';
str += ' { \n';
for (key in func) {
str += ' ' + key + ': ' + String(func[key]) + '\n';
function example(a, b) {}
example.length === 2; // returns => true
example(1, 2, 3);
// a === 1
// b === 2
// arguments[0] === 1
// arguments[1] === 2
/**
* A method to concat strings to avoid [plus overloading errors](http://www.crockford.com/javascript/javascript.html).
*
* @param {...*} val
* @return {string}
*/
function concatString(val) {
/** @type {string} */
var str;
@imaginate
imaginate / learning-resources.md
Last active December 19, 2018 21:37
Resources for learning about technical topics like computer science, programming, web development, algorithms, and more.

Grow Your Mind!

  • Computer Science: Offers in-depth resources for learning and improving your skills with computer science, programming, algorithms, data structures, and more.
  • Operating Systems: Covers operating systems and their tools.
  • Web Development: Offers abundant resources for topics like browsers, CSS, DOM, HTML, JavaScript, Node.js, PHP, and Python. It contains many different manuals, tools, libraries, shortcuts, and more.

Computer Science

CS Education

@imaginate
imaginate / feedback.md
Last active August 29, 2015 14:21
Algorithm IV Developer Tools: The Future - Feedback & Discussion
@imaginate
imaginate / find-duplicate-objects.js
Last active August 29, 2015 14:19
An efficient way to find duplicates in JavaScript - specifically the duplicate objects of two arrays. Time: O(m) | Space: O(n)
/**
* -----------------------------------------------
* Function (findDuplicates)
* -----------------------------------------------
* @desc Find the duplicate objects in two arrays. With m representing
* the length of the longest array and n the length of both arrays
* combined, this function operates in - Time: O(m) | Space: O(n).
* @param {Array<Object>} arr1 - The first array.
* @param {Array<Object>} arr2 - The second array.
* @return {Array<Object>} The duplicates.