This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://www.codewars.com/kata/515bb423de843ea99400000a/train/javascript | |
// TODO: complete this object/class | |
// The constructor takes in an array of items and a integer indicating how many | |
// items fit within a single page | |
function PaginationHelper(collection, itemsPerPage){ | |
this.items = collection; | |
this.itemsPerPage = itemsPerPage; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
# Dynamic Array | |
class DynamicArrays(object): | |
def __init__(self): | |
self.n = 0 | |
self.capacity = 1 | |
self.A = self.make_array(self.capacity) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! Python | |
# github.com/stevieoj | |
# 1. Given an array of N integers, find maximum difference, where the index of the largest number is greater than | |
# the index of smallest number. If not find the next smallest number. If condition cannot be met return -1. | |
# Time complexity: O(n) | |
# Space Complexity: O(1) | |
def max_difference(xs): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var k1 = {a: 1}; | |
var k2 = {b: 2}; | |
var map = new Map(); | |
var wm = new WeakMap(); | |
map.set(k1, 'k1'); | |
wm.set(k2, 'k2'); | |
k1 = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a React HOC that abstracts the selection logic from | |
// https://codepen.io/anon/pen/vPXyOo | |
const withSelector = (ComposedComponent) => ( | |
class extends React.Component { | |
state = { selected: false }; | |
handleSelect = () => { | |
this.setState({ selected: !this.state.selected }); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Each YouTube video has 4 generated images. They are predictably formatted as follows: | |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg | |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg | |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg | |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg | |
The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is: | |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[email protected] /Users/stevie/Desktop/cinder-web | |
βββ¬ @apollo/[email protected] | |
β βββ¬ @graphql-typed-document-node/[email protected] | |
β β βββ [email protected] deduped | |
β βββ¬ @wry/[email protected] | |
β β βββ [email protected] deduped | |
β βββ¬ @wry/[email protected] | |
β β βββ [email protected] deduped | |
β βββ¬ @wry/[email protected] | |
β β βββ [email protected] deduped |