This file contains 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 { expect, test, describe } from "vitest"; | |
import { transformText } from "./transformText"; | |
describe("transformText", () => { | |
test("should handle replacement commands across a word", () => { | |
expect(transformText("Hello World", "rhllllllrw")).toEqual("hello world"); | |
}); | |
test("handle multiple replace", () => { | |
expect(transformText("xxx", "3rY")).toEqual("YYY"); |
This file contains 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 os | |
from dotenv import load_dotenv | |
from pydantic_settings import BaseSettings | |
dotenv_path = f"{os.getcwd()}/.env" | |
load_dotenv(dotenv_path) | |
class AppConfig(BaseSettings): |
This file contains 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
/** | |
* @param {number} n | |
* @return {number} | |
*/ | |
var totalMoney = function(n) { | |
let total = 0 | |
let numWeeks = Math.floor(n / 7) | |
let remainingDays = n % 7 | |
for (let i=0; i < remainingDays; i++) { |
This file contains 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
let calculatedPrimes = new Set([2]) | |
function isPrime(n) { | |
let prime = true | |
if (n === 1) { | |
return false | |
} | |
if (calculatedPrimes.has(n)) { |
This file contains 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
# https://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit | |
alias remindMe="git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'" |
This file contains 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 { functionWithDependencyThatNeedsMocking } from './service'; | |
jest.mock('./service', () => { | |
...jest.requireActual('./service'); | |
dependencyThatNeedsMocking: jest.fn() | |
}) | |
it('should mock the call', () => { | |
const mySpy = jest.spyOn('./service', 'dependencyThatNeedsMocking') | |
This file contains 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
version: "3" | |
services: | |
a-postgres-container: | |
image: postgres:12 | |
ports: | |
- ${DB_PORT_SOME_EXTERNAL_BIND:-5432}:5432 | |
environment: | |
- POSTGRES_HOST=postgres | |
- POSTGRES_USER=my_user |
This file contains 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
// Place your key bindings in this file to override the defaultsauto[] | |
[ | |
{ | |
"key": "shift+alt+down", | |
"command": "editor.action.moveLinesDownAction", | |
"when": "editorTextFocus && !editorReadonly" | |
}, | |
{ | |
"key": "alt+down", | |
"command": "-editor.action.moveLinesDownAction", |
This file contains 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 logging | |
import tracemalloc | |
tracemalloc.start(10) | |
logger = logging.getLogger(__name__) | |
class MemoryTracer: | |
def __init__(self): |
This file contains 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
version: 2.0 | |
jobs: | |
venv: | |
docker: | |
- image: eatsindigo/phoebus-online-build | |
steps: | |
- add_ssh_keys | |
- checkout | |
- attach_workspace: | |
at: . |
NewerOlder