Skip to content

Instantly share code, notes, and snippets.

View drbh's full-sized avatar
🕳️
a for AI

drbh drbh

🕳️
a for AI
  • drbh
  • state space
  • 11:38 (UTC -04:00)
View GitHub Profile
@gd3kr
gd3kr / script.js
Created February 15, 2024 06:30
Download a JSON List of twitter bookmarks
/*
the twitter api is stupid. it is stupid and bad and expensive. hence, this.
Literally just paste this in the JS console on the bookmarks tab and the script will automatically scroll to the bottom of your bookmarks and keep a track of them as it goes.
When finished, it downloads a JSON file containing the raw text content of every bookmark.
for now it stores just the text inside the tweet itself, but if you're reading this why don't you go ahead and try to also store other information (author, tweetLink, pictures, everything). come on. do it. please?
*/
@younesbelkada
younesbelkada / finetune_llama_v2.py
Last active May 6, 2024 23:58
Fine tune Llama v2 models on Guanaco Dataset
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@kylemcdonald
kylemcdonald / function-calling.ipynb
Created June 14, 2023 01:10
Example of OpenAI function calling API to extract data from LAPD newsroom articles.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JoshOrndorff
JoshOrndorff / QuickNDirtyAutomation.js
Created October 7, 2019 16:40
Substrate Query Script
const { ApiPromise } = require('@polkadot/api');
const testKeyring = require('@polkadot/keyring/testing');
const aliceAddr = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';
const alicePair = testKeyring.default().getPair(aliceAddr);
/**
* Sends a transaction ot the chain returning a promise.
* When the transaction is finalized, resolve to the list of events received.
* When the transaction fails, reject relaying the error message.
@sundowndev
sundowndev / GoogleDorking.md
Last active May 9, 2024 18:41
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
@npearce
npearce / install-docker.md
Last active May 11, 2024 10:33
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@dio
dio / hello-wasm.js
Last active September 10, 2023 07:42
This is a simpe example on embedding wasm inside an offline single html page
// this code is from a simple add function in c:
//
// // hello.c
// int add(int a, int b) {
// return a + b;
// }
//
// compiles it with emcc (http://webassembly.org/getting-started/developers-guide/)
// $ git clone https://github.com/juj/emsdk.git
from math import log
def arbitrage(table):
transformed_graph = [[-log(edge) for edge in row] for row in graph]
# Pick any source vertex -- we can run Bellman-Ford from any vertex and
# get the right result
source = 0
n = len(transformed_graph)
min_dist = [float('inf')] * n
@katopz
katopz / setup-zeromq.sh
Last active August 10, 2021 21:47 — forked from cdjhlee/zeromq_install.sh
Setup zeromq in Ubuntu 16.04
#!/usr/bin/bash
# Download zeromq
# Ref http://zeromq.org/intro:get-the-software
wget https://github.com/zeromq/libzmq/releases/download/v4.2.2/zeromq-4.2.2.tar.gz
# Unpack tarball package
tar xvzf zeromq-4.2.2.tar.gz
# Install dependency
sudo apt-get update
sudo apt-get install golang-go -y
wget https://dist.ipfs.io/go-ipfs/v0.4.10/go-ipfs_v0.4.10_linux-386.tar.gz
tar xvfz go-ipfs_v0.4.10_linux-386.tar.gz
sudo mv go-ipfs/ipfs /usr/local/bin/ipfs