Skip to content

Instantly share code, notes, and snippets.

View janpauldahlke's full-sized avatar
🏠
Working from home

HagbardCeline janpauldahlke

🏠
Working from home
  • Germany
View GitHub Profile
@janpauldahlke
janpauldahlke / main.ts
Created July 22, 2024 13:27
consume ts only module from jsr
import { isOdd } from "@hail-discordia/is-odd-ts";
export function main() {
console.log(isOdd(2))
}
main()
@janpauldahlke
janpauldahlke / api_controller.ex
Created February 1, 2023 15:07
aipi controller help schmu
defmodule PortalWeb.ApiController do
@moduledoc """
The ApiController handles API requests.
"""
use PortalWeb, :controller
alias __MODULE__.ApiControllerHelper
alias PortalWeb.BuyLive
alias PortalWeb.Errors.InvalidProductNameError
alias PortalWeb.Errors.InvalidRequestError

https://beta.openai.com/playground

hi again do you have information and graphs or visuals for benchmarks rust versus elixir, the programming languages?

Unfortunately, there is not a lot of information available on direct comparisons between Rust and Elixir. However, there are some facts and figures that might be useful. For example, Rust is a multi-paradigm language that is an excellent choice for system programming, while Elixir is a functional programming language that excels at web development. In terms of speed, Elixir is generally faster than Rust, and it is also more memory efficient. In terms of popularity, Rust is much more widely used and has been around for much longer, while Elixir is relatively new and is gaining popularity.

so elixier is faster than rust on native programs?

Yes, in terms of speed, Elixir is generally faster than Rust for native programs.

@janpauldahlke
janpauldahlke / gist:d777b20c344ed69ed5d4f01177deb1ad
Created November 8, 2022 08:17
awesome-app dev errors on fedora 36
==== Running runner: npm_install
> executing: npm install
up to date, audited 122 packages in 863ms
39 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
==== Running runner: tauri_icons
[janpaul@fuckup rust_surreal]$ cargo build
Compiling value-bag v1.0.0-alpha.9
Compiling serde v1.0.147
Compiling thiserror v1.0.37
Compiling pin-project v1.0.12
Compiling wasm-bindgen-macro-support v0.2.83
Compiling time-macros v0.1.1
Compiling rquickjs-sys v0.1.7
Compiling zstd-sys v2.0.1+zstd.1.5.2
Compiling bzip2-sys v0.1.11+1.0.8
@janpauldahlke
janpauldahlke / readme.md
Created November 7, 2022 11:58
surrealDB CLI

hands on surrealdb

prequisites

install surreal:

sudo curl -sSf https://install.surrealdb.com | sh
import { R4 } from "@ahryman40k/ts-fhir-types";
import { Pipe, PipeTransform } from "@angular/core";
import { UntilDestroy } from "@ngneat/until-destroy";
import { Subscription } from 'rxjs/internal/Subscription';
import { LocalizedValueSetService } from "src/app/resources/foundation/terminology/value-set/state/localized-value-set.service";
import { ListItem } from 'src/app/state/abstract/list-item.model';
@UntilDestroy()
@Pipe({
name: 'dosageText',
@janpauldahlke
janpauldahlke / memoize-decorator.ts
Created January 27, 2022 10:18 — forked from Rush/memoize-decorator.ts
Using memoizee with observables
import { decorate } from 'core-decorators';
import * as memoize from 'memoizee';
import { duration, unitOfTime } from 'moment';
import { memoizeObservable } from './rxjs';
type HumanDuration = [number, unitOfTime.DurationConstructor];
export interface MemoizeOptions extends memoize.Options {
observable?: boolean;
ttl?: HumanDuration;
@janpauldahlke
janpauldahlke / careplan-editor.component.ts
Created August 30, 2021 10:18
careplan-editor.component.ts
export class CareplanEditorComponent implements OnInit, OnChanges, OnDestroy {
@Input() carePlanId: string | null = null;
carePlanForm = this.fb.group<CarePlanFormValue>({
//there are more, but those are relavant
start: [null, {
validators: [
Validators.required
],
asyncValidators: [
selectAllScopeCarePlans(scope: string): Observable<GroupedCarePlan> {
const result = this.selectAllScoped(scope).pipe(
distinctUntilChanged(),
first(),
//map by doNotPerform WI-7133
map((plans) => {
let groupedByPerform: GroupedCarePlan;
plans.map((plan) => {
//status active
if (!plan.activity[0]?.detail?.doNotPerform) {