Skip to content

Instantly share code, notes, and snippets.


HagbardCeline janpauldahlke

  • Germany
View GitHub Profile
janpauldahlke / api_controller.ex
Created February 1, 2023 15:07
aipi controller help schmu
View api_controller.ex
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
View gist:7ed9602fad1d0b4490c9f3771398d8b2

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 / gist:d777b20c344ed69ed5d4f01177deb1ad
Created November 8, 2022 08:17
awesome-app dev errors on fedora 36
View gist:d777b20c344ed69ed5d4f01177deb1ad
==== 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
View gist:03f5ae02379bb2bcee77c0018c8ebadb
[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 /
Created November 7, 2022 11:58
surrealDB CLI

hands on surrealdb


install surreal:

sudo curl -sSf | sh
View doseText.pipe.ts
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';
name: 'dosageText',
janpauldahlke / memoize-decorator.ts
Created January 27, 2022 10:18 — forked from Rush/memoize-decorator.ts
Using memoizee with observables
View memoize-decorator.ts
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 / careplan-editor.component.ts
Created August 30, 2021 10:18
View careplan-editor.component.ts
export class CareplanEditorComponent implements OnInit, OnChanges, OnDestroy {
@Input() carePlanId: string | null = null;
carePlanForm =<CarePlanFormValue>({
//there are more, but those are relavant
start: [null, {
validators: [
asyncValidators: [
View plan.query.ts
selectAllScopeCarePlans(scope: string): Observable<GroupedCarePlan> {
const result = this.selectAllScoped(scope).pipe(
//map by doNotPerform WI-7133
map((plans) => {
let groupedByPerform: GroupedCarePlan; => {
//status active
if (!plan.activity[0]?.detail?.doNotPerform) {
janpauldahlke / example_reduck.tsx
Created July 23, 2021 13:52
exmaple of reducks pattern in react
View example_reduck.tsx
import { Action } from 'redux';
/* wouldnt it be smarter jsut top pass an argument with _error object*/
enum NotificationActions {