Skip to content

Instantly share code, notes, and snippets.

View max's full-sized avatar
🏔️

Max Schoening max

🏔️
View GitHub Profile
@max
max / elysia-example.ts
Created November 25, 2023 23:14
elysia-example
import { Elysia, ErrorHandler, t } from "elysia";
import { logger } from "./lib/logger";
import bearer from "@elysiajs/bearer";
import config from "./lib/config";
import swagger from "@elysiajs/swagger";
import { OverlandSchema } from "./lib/overland";
class UnauthorizedError extends Error {
code = "UNAUTHORIZED";
status = 403;
@max
max / content.md
Created September 11, 2020 15:07
Gist from Drafts

This is a wonderful Gist!

name: My Cron Action
on:
schedule:
- cron: '*/15 * * * *'
jobs:
hello:
runs-on: ubuntu-latest
steps:
# If you need access to the source code of the repo
- uses: actions/checkout@v1
@max
max / i.sh
Last active April 24, 2019 17:33
#!/usr/bin/env sh
set -e
echo "Fetching fonts from Apple..."
curl -o /tmp/SF-Font.dmg https://developer.apple.com/design/downloads/SF-Font.dmg
hdiutil attach -nobrowse -quiet -noverify -noautoopen -mountpoint /Volumes/SF-Font /tmp/SF-Font.dmg
echo "Installing fonts..."
cp -R /Volumes/SF-Font/. /Library/Fonts/

The error handling for async/await with try/catch always bugs me. Go to the rescue?

function to(promise) {
  return promise
    .then(res => [null, data])
    .catch(err => [err])
}

async function doIt() {
sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app

Glimmer Apps

Light-weight UI components with the attention to detail you've come to expect from Ember.

Getting Started

Instead of worrying about project setup, configuration and glue code we want you to focus on writing components that just work. The fastest way to get started is to install the Ember CLI and leverage [a basic

@max
max / components.my-slider.js
Last active December 17, 2016 00:25
Slider
import Ember from 'ember';
export default Ember.Component.extend({
});
@max
max / flexi.css
Last active November 9, 2016 23:57
.element {
position: relative;
}
/**
* Screen: Create a wrapper around all of the content of a web page.
*/
.screen {
composes: element;