Skip to content

Instantly share code, notes, and snippets.

View petrbrzek's full-sized avatar
🥑
Cooking something

Petr Brzek petrbrzek

🥑
Cooking something
View GitHub Profile
@petrbrzek
petrbrzek / index.coffee
Created August 13, 2015 11:27
React keymaps idea
module.exports =
ProjectManager:
PROJECT_MANAGER_MOVE_LEFT:
osx:
'left'
windows:
'left'
linux:
'left'
PROJECT_MANAGER_MOVE_RIGHT:
@petrbrzek
petrbrzek / dabblet.css
Created April 1, 2012 09:59
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@petrbrzek
petrbrzek / this-is-it.js
Created April 11, 2022 22:03
Calculate compound interest with regular deposits and daily compounding period
const calculateCompoundInterest = ({
initialDeposit,
regularDeposit,
investmentInYears = 1,
depositFrequency = 12,
interestRate,
compoundPeriodsPerYear = 365
}) => {
// https://www.vertex42.com/Calculators/compound-interest-calculator.html#rate-per-period
import { EditorCanvas, useEditor } from "@opendesign/react";
import { importFile } from "@opendesign/universal";
import { Suspense, useState } from "react";
export function MinimalImport() {
const [design, setDesign] = useState();
if (!design) {
return (
<input
type="file"
{"shapes":[{"coords":[{"lat":50.079385684841846,"lng":14.601874411718523},{"lat":50.079389127326145,"lng":14.601804003731882},{"lat":50.07937750894068,"lng":14.601737619058763},{"lat":50.079367181484564,"lng":14.601740971820032},{"lat":50.07934609625476,"lng":14.601803333179628},{"lat":50.07934394470017,"lng":14.601739630715524},{"lat":50.07930521670113,"lng":14.60174231292454},{"lat":50.07931855634877,"lng":14.601812050358927},{"lat":50.07931339261464,"lng":14.601876423375284},{"lat":50.07934480532201,"lng":14.601817414776956},{"lat":50.07934781749835,"lng":14.601878435032045},{"lat":50.07937363614489,"lng":14.601875082270777}],"heights":[4.5,7.9,4.5,4.9,7.5,7.5,4.5,7.9,4.5,7.5,7.5,4.9]},{"coords":[{"lat":50.07940289726083,"lng":14.601738289611017},{"lat":50.07937966049376,"lng":14.601737619058763},{"lat":50.07938955763667,"lng":14.601804003731882},{"lat":50.079385684841846,"lng":14.60187374116627},{"lat":50.079408060985315,"lng":14.601871729509508},{"lat":50.079409782226705,"lng":14.601804674284136}],"heigh
@petrbrzek
petrbrzek / langtail-simple-fetch.ts
Last active February 7, 2024 16:25
Langtail simple chat completition fetch in TypeScript
async function getChatCompletion({
promptName,
variables,
}: {
promptName: string
variables: Record<string, string>
}) {
const workspace = '<YOUR_WORKSPACE>' // Replace <YOUR_WORKSPACE> with your actual workspace ID
const project = '<YOUR_PROJECT>' // Replace <YOUR_PROJECT> with your actual project ID
const env = 'production'