Skip to content

Instantly share code, notes, and snippets.

View betacar's full-sized avatar
🤓
Tidsoptimist

Carlos Betancourt Carrero betacar

🤓
Tidsoptimist
View GitHub Profile
@veekaybee
veekaybee / normcore-llm.md
Last active May 6, 2024 16:10
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@TrillCyborg
TrillCyborg / mastodon-docker-setup.md
Last active May 5, 2024 22:42
Mastodon Docker Setup

Mastodon Docker Setup

Setting up

Clone Mastodon's repository.

# Clone mastodon to ~/live directory
git clone https://github.com/tootsuite/mastodon.git live
# Change directory to ~/live

cd ~/live

@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active April 19, 2024 01:50
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@CTimmerman
CTimmerman / SVG_to_PNG.js
Last active April 5, 2024 12:26
Convert SVG to PNG / save SVG as PNG
// SVG2PNG
// By Cees Timmerman, 2024-04-05.
// Paste into console and adjust indices as needed.
let im = document.getElementsByTagName('img')
let fname = location.href
if (im.length < 1) {
let svg = document.getElementsByTagName('svg')[0]
let bb = svg.getBBox()
im = new Image(bb.width, bb.height)
im.src = 'data:image/svg+xml;charset=utf-8;base64,' + btoa(document.getElementsByTagName('svg')[0].outerHTML)
@tobydeh
tobydeh / moleculer-k8.md
Last active March 20, 2024 11:55
Moleculer k8 depoyment

Create a cluster on GKE:

gcloud container clusters create backend --num-nodes=2 --machine-type n1-standard-4

Get credentials:

gcloud container clusters get-credentials backend

Build the docker image:

@jboner
jboner / OrderManagement.scala
Created November 10, 2017 09:08
Demo of an Event-driven Architecture in Akka and Scala. Show-casing Events-first DDD, Event Sourced Aggregates, Process Manager, etc.
package sample.eventdriven.scala
import akka.actor.{Actor, ActorRef, ActorSystem, Inbox, Props}
import akka.persistence.PersistentActor
import scala.concurrent.ExecutionContext.Implicits._
import scala.concurrent.duration._
// ===============================================================
// Demo of an Event-driven Architecture in Akka and Scala.
@jkrems
jkrems / index.md
Last active November 3, 2023 14:34
JavaScript: Classic Scripts vs. Modules vs. CommonJS

JavaScript File Format Differences

There's the pervarsive notion that all JS is created equal and that there's only minor and easily detectable differences between the various file formats used to author JavaScript. This is correct, from a certain point of view.

A certain point of view?

For many people writing JavaScript that gets passed into build tools,

@LeZuse
LeZuse / detect.py
Created May 2, 2012 18:28
Flask browser detection
browser = request.user_agent.browser
version = request.user_agent.version and int(request.user_agent.version.split('.')[0])
platform = request.user_agent.platform
uas = request.user_agent.string
if browser and version:
if (browser == 'msie' and version < 9) \
or (browser == 'firefox' and version < 4) \
or (platform == 'android' and browser == 'safari' and version < 534) \
or (platform == 'iphone' and browser == 'safari' and version < 7000) \

Visual Studio Code shortcuts I use often

Navigation

Sidebar:

  • Cmd-Shift-F: search
  • Cmd-Shift-E: files

Navigating in current editor:

@snowkidind
snowkidind / README.md
Last active November 11, 2021 16:53
TDAmeritrade API Notes for Node.js

Access to Ameritrade API

notes that may be helpful for node.js devs

What I've gathered is authorization tokens must be earned first. Authorization tokens are good for three months, once you are setup, you will get two tokens which come as long strings, An access_token and a refresh_token. Access tokens are only valid for 30 minutes so you will need to code to refresh the session using the refresh token frequently. When you refresh, you are given a new access token and that is what you use to "login" or pull from the api for the next period. But in order to get the tokens, you will be required to go through some processes to get a valid token that applies to your app. The following text kind of steers you in that direction...

Making an app

On the api site you will need to make an app, where you pick some random name by using some random numbers. It should be automatically generated but it isnt. For this field item, I simply went to https://www.uuidgenerator.net/ and just grabbed the firs