Skip to content

Instantly share code, notes, and snippets.

View rymalia's full-sized avatar

Ryan rymalia

View GitHub Profile

How to install dlib v19.9 or newer (w/ python bindings) from github on macOS and Ubuntu

Pre-reqs:

  • Have Python 3 installed. On macOS, this could be installed from homebrew or even via standard Python 3.6 downloaded installer from https://www.python.org/download. On Linux, just use your package manager.
  • On macOS:
    • Install XCode from the Mac App Store (or install the XCode command line utils).
    • Have homebrew installed
  • On Linux:
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@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?
*/
@gd3kr
gd3kr / embeddings.py
Created February 15, 2024 20:35
compute embeddings for tweets in tweets.json
"""
a simple script that reads tweets inside a json file, uses openai to compute embeddings and creates two files, metadata.tsv and output.tsv, which cam be used to visualise the tweets and their embeddings in TensorFlow Projector (https://projector.tensorflow.org/)
"""
# obtain tweets.json from https://gist.github.com/gd3kr/948296cf675469f5028911f8eb276dbc
import pandas as pd
import json
from openai import OpenAI
@AkashMV
AkashMV / script.js
Last active March 13, 2024 06:18 — forked from gd3kr/script.js
Download a JSON List of people you follow on twitter
//there are issues with how we manage to skip pixels.
//accounts are getting skipped.
let following = []; // Initialize an empty array to hold all elements of people you follow
let formattedFollowers = []
const scrollInterval = 2000;
const scrollStep = 2000; // Pixels to scroll on each step
let previousFollowingCount = 0;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@luighifeodrippe
luighifeodrippe / script.js
Last active February 22, 2024 19:35 — forked from gd3kr/script.js
Download a JSON List of twitter bookmarks
/* Enhancements to the Twitter Scraping Script:
This update to the script introduces a more robust mechanism for extracting detailed interaction data from tweets as they are scraped from Twitter. Previously, the script focused on collecting basic content such as the tweet's text. Now, it has been augmented to include a comprehensive extraction of interaction metrics, including replies, reposts, likes, bookmarks, and views, for each tweet.
Key Changes:
1. Improved Data Extraction:
- The script now searches through all elements within a tweet that have an `aria-label` attribute, filtering for labels that contain key interaction terms (replies, reposts, likes, bookmarks, views). This ensures that only relevant `aria-labels` are considered for data extraction.
2. Flexible Interaction Data Parsing:
@cbednarski
cbednarski / camera.py
Last active February 17, 2024 05:54
Webcam capture for python - Pops up a preview from your webcam and snaps a picture when you press 'q'
import cv2
# Windows dependencies
# - Python 2.7.6: http://www.python.org/download/
# - OpenCV: http://opencv.org/
# - Numpy -- get numpy from here because the official builds don't support x64:
# http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
# Mac Dependencies
# - brew install python
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@ynagatomo
ynagatomo / SD2ContentView.swift
Created December 4, 2022 08:56
An iOS app that generates images using Stable-Diffusion-v2 CoreML models.
//
// ContentView.swift
// coremlsd2test
//
// Created by Yasuhito Nagatomo on 2022/12/03.
//
// A sample code using Apple/ml-stable-diffusion library.
// Preparation:
// 1. convert the PyTorch Stable-Diffusion v2 model to coreml models using Apple's tools.
// 2. import the coreml models into the iOS project.