If yout have problems for check ruby versions on your ubuntu + zsh, just put this in your terminal and set path for your rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshenv
$ echo 'eval "$(rbenv init -)"' >> ~/.zshenv
{ | |
"[astro]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, | |
"[css]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, | |
"[dockercompose]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, |
postgres: | |
image: postgres:14.6-alpine | |
ports: | |
- '5432:5432' | |
environment: | |
POSTGRES_USER: 'user' | |
POSTGRES_PASSWORD: 'password' | |
POSTGRES_DB: 'database' | |
volumes: | |
- ./init:/docker-entrypoint-initdb.d/ |
# Repository or organization name | |
> Description | |
## Build Setup | |
``` bash | |
# install dependencies | |
npm install or yarn |
import React from 'react'; | |
import styled from 'styled-components'; | |
const Button = styled.a` | |
line-height: 2; | |
height: 5rem; | |
text-decoration: none; | |
display:inline-flex; | |
color: #FFFFFF; | |
background-color: #FF813F; |
Jest Mock Any Property on Window Utility - with automatic cleanup.
/* This is intentionally blank just and exists to secure a decent gist name */ |
Design an API that save game speedruns and serves a leaderboard.
In several games, finishing the game is deemed just too easy for some gamers, so they decide to see how fast they can finish the entire game. In fact, speedruns became so popular that many players compete with other players to see if they can break each other records, even if that means beating the time by just a couple of seconds. We want to create an API that can registers those records and also serve a leaderboard.
/* | |
* I saw this thread: http://stackoverflow.com/questions/840781/easiest-way-to-find-duplicate-values-in-a-javascript-array | |
* The solutions from gist:1305056 were elegant, but wrong. So here's mine: | |
*/ | |
Array.prototype.unique = function(test) { | |
/* returns a new, sorted Array without duplicates */ | |
if (!Array.isArray(this)) | |
throw new TypeError("Array.prototype.unique must be called on an Array"); | |
return this.slice(0).sort().filter( typeof test == "function" | |
? function(v, i, a) { return !i || !test(v, a[i-1]); } |