Skip to content

Instantly share code, notes, and snippets.

View onixus74's full-sized avatar
🔮
Currently enchanting distributed systems with ML magic 🧪🔮💻

Marwen Ounis onixus74

🔮
Currently enchanting distributed systems with ML magic 🧪🔮💻
  • Copia Wealth Studios
  • Montreal
View GitHub Profile
/*
This svelte store is a reference to make super quick live and interactive pieces of code.
See its announcement at https://www.youtube.com/watch?v=A8jkJTWacow&t=18579s
*/
type Options<T> = {
validator: (data: T) => void;
};
export function live<T>(path: string, initialValue: T, options?: Options<T>) {
@onixus74
onixus74 / README.md
Created October 25, 2021 14:05 — forked from petermueller/README.md
Phoenix + esbuild + yarn + postcss + tailwindcss + cpx2

Getting started

If you just want to copy-paste this it should "just work", but you'll need to get yarn set up. Follow the instructions at https://yarnpkg.com/getting-started/install OR just run:

  • npm install -g yarn
  • yarn set version berry
  • yarn install # this should make a .yarn/, yarn.lock, and .pnp.js

Mix Tasks

If you want to run these outside of the context of a running phoenix server, you can also run the mix tasks, mix assets.install and mix assets.compile. They are a copy paste of some the CLI bits but you could abstract them out to point to a config/cmds.exs or something if you wanted.

esbuild

@petermueller
petermueller / README.md
Last active September 29, 2023 10:41
Phoenix + esbuild + yarn + postcss + tailwindcss + cpx2

Getting started

If you just want to copy-paste this it should "just work", but you'll need to get yarn set up. Follow the instructions at https://yarnpkg.com/getting-started/install OR just run:

  • npm install -g yarn
  • yarn set version berry
  • yarn install # this should make a .yarn/, yarn.lock, and .pnp.js

Mix Tasks

If you want to run these outside of the context of a running phoenix server, you can also run the mix tasks, mix assets.install and mix assets.compile. They are a copy paste of some the CLI bits but you could abstract them out to point to a config/cmds.exs or something if you wanted.

esbuild

@goofansu
goofansu / app.js
Last active August 5, 2023 04:05
LiveView upload directly to AWS China S3
let Uploaders = {}
Uploaders.S3 = function (entries, onViewError) {
entries.forEach(entry => {
let xhr = new XMLHttpRequest()
onViewError(() => xhr.abort())
xhr.onload = () => (xhr.status === 200 ? entry.done() : entry.error())
xhr.onerror = () => entry.error()
xhr.upload.addEventListener("progress", event => {
if (event.lengthComputable) {
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
diff --git a/assets/js/App.svelte b/assets/js/App.svelte
new file mode 100644
index 0000000..221cde6
--- /dev/null
+++ b/assets/js/App.svelte
@@ -0,0 +1,5 @@
+<script>
+ export let name;
+</script>
@hpcsc
hpcsc / hack.sh
Created March 3, 2019 12:43
md viewer in terminal
#!/usr/bin/env bash
FZF_DEFAULT_OPTS="--reverse --height 30% --header 'Choose markdown file'"
CACHE_DIR=$HOME/.hack/
function check_prerequisite() {
local prerequisites=(curl mdless jq fzf)
for tool in ${prerequisites[@]}; do
type ${tool} >/dev/null 2>&1 || { echo >&2 "I require $tool but it's not installed."; exit 1; }
@Rich-Harris
Rich-Harris / what-is-svelte.md
Last active February 18, 2025 07:11
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question:

@kauffmanes
kauffmanes / install_anaconda.md
Last active March 2, 2025 23:38
Install Anaconda on Windows Subsystem for Linux (WSL)

Thanks everyone for commenting/contributing! I made this in college for a class and I no longer really use the technology. I encourage you all to help each other, but I probably won't be answering questions anymore.

This article is also on my blog: https://emilykauffman.com/blog/install-anaconda-on-wsl

Note: $ denotes the start of a command. Don't actually type this.

Steps to Install Anaconda on Windows Ubuntu Terminal

  1. Install WSL (Ubuntu for Windows - can be found in Windows Store). I recommend the latest version (I'm using 18.04) because there are some bugs they worked out during 14/16 (microsoft/WSL#785)
  2. Go to https://repo.continuum.io/archive to find the list of Anaconda releases
  3. Select the release you want. I have a 64-bit computer, so I chose the latest release ending in x86_64.sh. If I had a 32-bit computer, I'd select the x86.sh version. If you accidentally try to install the wrong one, you'll get a warning in the terminal. I chose `Anaconda3-5.2.0-Li
@steebchen
steebchen / install-helm.sh
Created September 6, 2018 16:09
install helm on k8s kubeadm cluster with rbac
# install helm
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
kubectl create serviceaccount -n kube-system tiller
kubectl create clusterrolebinding tiller-binding --clusterrole=cluster-admin --serviceaccount kube-system:tiller
# run tiller with specific tiller account
helm init --service-account tiller