Skip to content

Instantly share code, notes, and snippets.

View jachinte's full-sized avatar

Miguel Jimenez jachinte

View GitHub Profile
@Alecton4
Alecton4 / icons.all.ts
Created September 28, 2023 10:22
List of all Elastic UI Icons with `appendIconComponentCache`
// NOTE: This file exists because of a known issue with EUI.
import { ICON_TYPES } from "@elastic/eui";
import { appendIconComponentCache } from "@elastic/eui/es/components/icon/icon";
import { icon as accessibility } from "@elastic/eui/es/components/icon/assets/accessibility";
import { icon as addDataApp } from "@elastic/eui/es/components/icon/assets/app_add_data";
import { icon as advancedSettingsApp } from "@elastic/eui/es/components/icon/assets/app_advanced_settings";
import { icon as agentApp } from "@elastic/eui/es/components/icon/assets/app_fleet";
import { icon as aggregate } from "@elastic/eui/es/components/icon/assets/aggregate";
import { icon as analyzeEvent } from "@elastic/eui/es/components/icon/assets/analyzeEvent";
@j4w8n
j4w8n / implement-user-api-keys-with-supabase.md
Last active October 16, 2024 12:05
Implement user API keys with Supabase

Implement user API keys with Supabase

This is pretty much my first crack at this. I'm sure things could be improved or done differently.

Rationale

JWTs are at the heart of Supabase authorization, but sometimes we wanna build an app that also gives users access via API keys; or perhaps only exclusively via API keys. As you may know, using JWTs as API keys makes them difficult to revoke and therefore a security issue.

We also want to ensure this doesn't significantly add to RLS polices, if at all.

Finally, we'd love to have this handled by Supabase and do as little as possible in our framework. This simplifies our code and reduces third-party libraries.

@cedrickchee
cedrickchee / llama-7b-m1.md
Last active November 5, 2024 19:40
4 Steps in Running LLaMA-7B on a M1 MacBook with `llama.cpp`

4 Steps in Running LLaMA-7B on a M1 MacBook

The large language models usability

The problem with large language models is that you can’t run these locally on your laptop. Thanks to Georgi Gerganov and his llama.cpp project, it is now possible to run Meta’s LLaMA on a single computer without a dedicated GPU.

Running LLaMA

There are multiple steps involved in running LLaMA locally on a M1 Mac after downloading the model weights.

@FelixZY
FelixZY / supabase_api_auth.sql
Last active August 22, 2024 21:19
How to configure Supabase (https://supabase.com/) to generate and accept API tokens.
-- Token Based API Access for Supabase
--
-- How to configure Supabase (https://supabase.com/) to generate and accept API tokens.
--
-- (c) 2022 Felix Zedén Yverås
-- Provided under the MIT license (https://spdx.org/licenses/MIT.html)
--
-- Disclaimer: This file is formatted using pg_format. I'm not happy with the result but
-- prefer to follow a tool over going by personal taste.
--
@lawrencecchen
lawrencecchen / $.ts
Last active July 10, 2024 07:32
next-auth with remix
// app/routes/api/auth/$.ts
import NextAuth from "~/lib/next-auth/index.server";
export const { action, loader } = NextAuth({
providers: [
GoogleProvider({
clientId: env.GOOGLE_CLIENT_ID,
clientSecret: env.GOOGLE_CLIENT_SECRET,
}),
],
@srdjan
srdjan / 100+ different counter apps...
Last active May 6, 2024 05:13
100+ different js counter apps...
100+ different js counter apps...
@knowbody
knowbody / ProfileBadge.js
Created May 4, 2016 09:36
Profile badge component
import React, { PropTypes } from 'react';
import { View, Text, StyleSheet } from 'react-native';
const colors = [
'salmon', 'tomato', 'gold', 'yellowgreen', 'deepskyblue',
'mediumspringgreen', 'darkturquoise', 'lightcoral', 'teal',
'maroon', 'mediumseagreen', 'peru', 'plum', 'cadetblue',
'darkorchid', 'palevioletred', 'lightgreen', 'limegreen',
'indigo', 'coral', 'chocolate', 'orangered', 'lightskyblue'
];
@knowbody
knowbody / import.json
Created April 26, 2016 15:16
My Atom Setup (use https://atom.io/packages/config-import-export to import/export)
{"version":1.02,"files":[{"file":".gitignore","content":{"type":"Buffer","data":[98,108,111,98,45,115,116,111,114,101,10,99,111,109,112,105,108,101,45,99,97,99,104,101,10,100,101,118,10,115,116,111,114,97,103,101,10,46,110,111,100,101,45,103,121,112,10,46,110,112,109,10]}},{"file":"config.cson","content":{"type":"Buffer","data":[34,42,34,58,10,32,32,34,97,116,111,109,45,109,97,116,101,114,105,97,108,45,117,105,34,58,10,32,32,32,32,99,111,108,111,114,115,58,10,32,32,32,32,32,32,97,98,97,115,101,67,111,108,111,114,58,10,32,32,32,32,32,32,32,32,97,108,112,104,97,58,32,49,10,32,32,32,32,32,32,32,32,98,108,117,101,58,32,50,52,51,10,32,32,32,32,32,32,32,32,103,114,101,101,110,58,32,49,53,48,10,32,32,32,32,32,32,32,32,114,101,100,58,32,51,51,10,32,32,32,32,32,32,112,114,101,100,101,102,105,110,101,100,67,111,108,111,114,58,32,34,66,108,117,101,34,10,32,32,32,32,102,111,110,116,115,58,32,123,125,10,32,32,32,32,116,97,98,115,58,10,32,32,32,32,32,32,116,105,110,116,101,100,84,97,98,66,97,114,58,32,116,114,117,101,10,32
@julz
julz / main.go
Created November 20, 2015 12:39
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
@ericelliott
ericelliott / essential-javascript-links.md
Last active November 8, 2024 17:29
Essential JavaScript Links