[JIRA]
This PR...
Before | After |
---|---|
Develop | Deployment URL |
use std::collections::HashMap; | |
// O(n^2) | |
// O(n) | |
fn want_change(have: Vec<i32>, want: i32) -> Vec<i32> { | |
let mut map = HashMap::new(); // { num: i } | |
let mut res = vec![]; | |
// a + b === want |
. $HOME/.asdf/asdf.sh | |
export VOLTA_HOME="$HOME/.volta" | |
export PATH="$VOLTA_HOME/bin:$PATH" | |
alias ..='cd ..' | |
alias ...='cd ../..' | |
alias ....='cd ../../..' | |
alias .....='cd ../../../..' | |
alias ls='ls' | |
# Empty the trash folder that is created when you delete things as root |
[JIRA]
This PR...
Before | After |
---|---|
Develop | Deployment URL |
function lastModifiedDate(updatedDate, intl) { | |
const today = new Date(); | |
const yesterday = subDays(today, 1); | |
const aWeekAgo = subDays(today, 7); | |
const twoWeeksAgo = subDays(today, 14); | |
const threeWeeksAgo = subDays(today, 21); | |
const locNamespace = 'Last Updated'; | |
// Get the date in English locale to match English day of week keys | |
const compare = parseISO(updatedDate); |
import Helper from '@ember/component/helper'; | |
import { inject as service } from '@ember/service'; | |
import { assert } from '@ember/debug'; | |
import { tracked } from '@glimmer/tracking'; | |
class AsyncData { | |
constructor(list) { | |
if (list) { | |
this._value = []; | |
} |
import { tracked } from '@glimmer/tracking'; | |
import { resolve } from 'rsvp'; | |
export class StatefulPromise { | |
declare promise: Promise<unknown> | null; | |
declare isDestroyed: boolean; | |
declare isDestroying: boolean; | |
@tracked isPending: boolean = false; |
const makeArray = (size) => [...Array(size)].map(() => size); | |
const small = makeArray(1000); | |
const medium = makeArray(10000000); | |
const large = makeArray(100000000); | |
const solution1 = (arr) => { | |
arr.includes(arr.length - 1); | |
}; |
const minute = 60; | |
const hour = minute * 60; | |
const day = hour * 24; | |
const week = day * 7; | |
const month = day * 30; | |
const year = day * 365; | |
/** | |
* Convert a date to a relative time string, such as | |
* "a minute ago", "in 2 hours", "yesterday", "3 months ago", etc. |
Here, we intend a component that can be used for something like a user menu in a nav. Maybe you've heard it called "popover" or something like that.
It is not meant to be a select
element, or used in a <form>
.
Goals:
// The global revision clock. Every time state changes, the clock increments. | |
let $REVISION = 0; | |
// The current dependency tracker. Whenever we compute a cache, we create a Set | |
// to track any dependencies that are used while computing. If no cache is | |
// computing, then the tracker is null. | |
let CURRENT_TRACKER = null; | |
// Storage represents a root value in the system - the actual state of our app. | |
class Storage { |