As configured in my dotfiles.
start new:
tmux
start new with session name:
| /** | |
| * All Tests Pass: Week 1 | |
| * Given an array of integers, find out if any two items in the array add up to | |
| * the target. For example, sumsToTarget([1,2], 3) should return true, but | |
| * sumsToTarget([1,2], 4) should return false. | |
| */ | |
| function sumsToTarget(integers = [], target) { | |
| const uniqueIntegers = new Set(integers); |
| // Trie.js - super simple JS implementation | |
| // https://en.wikipedia.org/wiki/Trie | |
| // ----------------------------------------- | |
| // we start with the TrieNode | |
| function TrieNode(key) { | |
| // the "key" value will be the character in sequence | |
| this.key = key; | |
As configured in my dotfiles.
start new:
tmux
start new with session name:
I ran into this and figured out what was going on; for the sake of future google searchers here is what might be happing if you see this error.
I was in a project with vendored dependencies, so 2 version of lib/pq existed: one in my project's vendor/ directory and another in $GOPATH/src/github.com/lib/pq. Normally this wouldn't be an issue, since the project should use the vendored one. But I failed to vendor a third dependency (in this case mattest/migrate), so it was getting built out of my GOPATH, and that imports lib/pq so used the GOPATH version of lib/pq for that. So two lib/pq packages would get built, both have their init() called... boom
| const jwt = require('jsonwebtoken'); | |
| const config = require('../../config'); | |
| module.exports = (req, res, next) => { | |
| try { | |
| const [_, token] = req.get('Authorization').split(' '); | |
| if (!token) return res.status(401).end(); | |
| const decodedToken = jwt.verify(token, config.JWT_SECRET, { |
| const withIsRequired = validatorFn => { | |
| const _customPropValidator = (isRequired = false) => (props, propName, componentName) => { | |
| const value = props[propName]; | |
| if (value == null) { | |
| if (isRequired) { | |
| return new Error(`Required \`${propName}\` was not specified in \`${componentName}\`.`); | |
| } | |
| return undefined; | |
| } | |
| return validatorFn(props, propName, componentName); |
| ' We declare a bunch of variables to hold which column each piece of data we want is | |
| Public columnRange As String | |
| Public notesColumn As String | |
| Public ageColumn As String | |
| Public maritalStatus As String | |
| Public incomeColumn As String | |
| Public occupationColumn As String | |
| Public firstNameColumn As String | |
| Public lastNameColumn As String | |
| Public employerColumn As String |
| import React from 'react'; | |
| const defaultOpts = {}; | |
| // Technically works more like useFetchLatest | |
| // If you supply opts make sure that it is memoized | |
| export function useFetch(url, opts = defaultOpts) { | |
| const [{ data, error, fetching }, setState] = React.useState({ | |
| data: null, | |
| error: null, |
| vim.api.nvim_create_user_command("RotateWindows", function() | |
| local ignored_filetypes = { "NvimTree", "fidget", "Outline" } | |
| local window_numbers = vim.api.nvim_tabpage_list_wins(0) | |
| local windows_to_rotate = {} | |
| for _, window_number in ipairs(window_numbers) do | |
| local buffer_number = vim.api.nvim_win_get_buf(window_number) | |
| local filetype = vim.bo[buffer_number].filetype | |
| if not vim.tbl_contains(ignored_filetypes, filetype) then |