Skip to content

Instantly share code, notes, and snippets.

@adrienbrault
adrienbrault / llama2-mac-gpu.sh
Last active April 8, 2025 13:49
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM. UPDATE: see https://twitter.com/simonw/status/1691495807319674880?s=20
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
make clean
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
@robertainslie
robertainslie / submit-to-hubspot-forms-api-with-javascript.md
Last active May 6, 2025 19:36
Submitting to the HubSpot Forms API with JavaScript

Overview

This tutorial will walk you through how to submit to the HubSpot Forms API using Javascript. Check out the documentation for submitting to the Forms API.

  • It will use vanilla JS (i.e. no libraries or frameworks) and will provide example code.
  • It will assume that you are familiar with HubSpot, HubSpot Forms, and that the HubSpot Tracking Code is on the page.

A note on the HubSpot cookie: hubspotutk

The HubSpot tracking code is a javascript snippet that is placed on websites. It anonymously collects website visit data, similar to Google Analytics. This anonymous visit data can be associated to HubSpot Contact record through a few means, including sending a usertoken value when submitting data to the Forms API. The tracking code generates a cookie containing a unique usertoken called hubspotutk. The value of hubspotutk will be submitted in our form submission as hutk. HubSpot uses this cookie value to connect visito

@Hribek25
Hribek25 / simple_message.sh
Created May 3, 2021 16:22
How to send IOTA non-value message via simple bash
INDEX_PAYLOAD=$(printf "hello-world-index" | xxd -ps)\
&& DATA_PAYLOAD=$(printf "some data" | xxd -ps)\
&& PAYLOAD=$(echo -e "{\"payload\": {\"type\": 2,\"index\": \"$INDEX_PAYLOAD\", \"data\": \"$DATA_PAYLOAD\"}}")\
&& curl --request POST --header "Content-Type: application/json" --data "$PAYLOAD" --url https://api.lb-0.testnet.chrysalis2.com/api/v1/messages
@Axel-Erfurt
Axel-Erfurt / celluloidTV.m3u
Last active May 2, 2025 20:47
Livestreams deutscher TV-Sender
#EXTM3U
#EXTINF:-1,ARD
https://daserste-live.ard-mcdn.de/daserste/live/hls/de/master.m3u8
#EXTINF:-1,ARD ONE
https://mcdn-one.ard.de/ardone/hls/master.m3u8
#EXTINF:-1,ARD Alpha
https://mcdn.br.de/br/fs/ard_alpha/hls/de/master.m3u8
#EXTINF:-1,ARD Tagesschau
https://tagesschau.akamaized.net/hls/live/2020115/tagesschau/tagesschau_1/master.m3u8
#EXTINF:-1,ZDF
@webdeb
webdeb / Hasura Keycloak.md
Last active October 29, 2022 19:03
Basic Keycloak Script Mapper to provide Hasura claims

Steps to provide Hasura Claims in Keycloak generated JWT

  1. Create your realm / client
  2. Inside client configuration go to "Mappers"
  3. Click on "Create"
  4. Name it "hasura"
  5. Choose Mapper Type "Script Mapper"
  6. Add following script to demonstrate how it works
version: '3.1'
services:
reverse-proxy:
image: traefik # The official Traefik docker image
command: --api --docker # Enables the web UI and tells Traefik to listen to docker
ports:
- "80:80" # The HTTP port
- "8080:8080" # The Web UI (enabled by --api)
volumes:
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
@deviantony
deviantony / README.md
Created March 8, 2018 01:24
Portainer admin password in a docker-compose environment

Portainer compose deployment with admin password preset

This file aims to explain how to deploy Portainer inside a compose file with the admin password already set.

Generate the admin password

For this example, we'll use the password superpassword.

Use the following command to generate a hash for the password:

@shivamkr19
shivamkr19 / download-egghead-io-videos.md
Last active February 4, 2022 09:48
Download free egghead.io videos

Download free egghead.io videos

Download Egghead.io videos using Lynx Browser and youtube-dl. This method will only work for videos that do not require a pro account.

Prerequesits

You need a Unix/Linux box with Lynx console browser and Youtube-dl installed.

➜ ~ cat /dev/urandom | xxd -c 100 | awk '{print toupper($0)}' | sed 's/[^A-Z9]//g' | head -c 81
DCFDBBACECDAEAFCACDFBCAFCFE9BFBC9ACEDBD9FCCFFEBCFCBCDEEEFFBF9AAEFDCE9DC9FEDCAEECF%
@barbietunnie
barbietunnie / udemy-courses-download-using-cookies.md
Last active May 5, 2025 06:21
Downloading Udemy videos with youtube-dl

How to download your Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.
$ youtube-dl {course_link} --cookies {path_to_cookies_file}