Skip to content

Instantly share code, notes, and snippets.

View georgkreimer's full-sized avatar
☠️
Hack the planet!

Georg Kreimer georgkreimer

☠️
Hack the planet!
View GitHub Profile
@peterc
peterc / embedding_store.rb
Last active December 28, 2023 06:27
Using SQLite to store OpenAI vector embeddings from Ruby
# Example of using SQLite VSS with OpenAI's text embedding API
# from Ruby.
# Note: Install/bundle the sqlite3, sqlite_vss, and ruby-openai gems first
# OPENAI_API_KEY must also be set in the environment
# Other embeddings can be used, but this is the easiest for a quick demo
# More on the topic at
# https://observablehq.com/@asg017/introducing-sqlite-vss
# https://observablehq.com/@asg017/making-sqlite-extension-gem-installable
@lukeed
lukeed / OSX-Dock-Spacers.md
Last active November 12, 2021 20:51
OSX Dock Spacers

Huh?

Some MacOS users have very cluttered Docks & wish they could organize them without removing any App icons from the mix.

This snippet will add an empty "spacer" that you can drag around and use to separate icons into groups! See example.

Command

Paste this into your Terminal. Run the command for additional placeholders!

@morganrallen
morganrallen / esp32.md
Last active January 6, 2022 13:57
ESP32 hacking notes

Basic hookup

As I plan to make a custom breakout board I wanted to solder as few connections as possible. I was able to boot the device, with UART (out at least) soldering the following.

PIN NAME
0 GND
1 3V3
2 EN
@dnegstad
dnegstad / Brocfile.js
Last active January 2, 2019 17:50
Polymer WebComponents in ember-cli >= 0.0.41
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var pickFiles = require('broccoli-static-compiler');
var mergeTrees = require('broccoli-merge-trees');
var vulcanize = require('broccoli-vulcanize');
var app = new EmberApp();
var polymerVulcanize = vulcanize('app', {
input: 'elements.html',
output: 'assets/vulcanized.html',
@pjobson
pjobson / remove_mcafee.md
Last active March 26, 2024 04:26
OSX McAfee Removal

Removal of McAfee from OSX

Note: This was written in 2015, it may be out of date now.

There are a lot of commands here which I use sudo if you don't know what you're doing with sudo, especially where I rm you can severely screw up your system.

There are many reasons which you would want to remove a piece of software such as McAfee, such as not wanting it to hammer your CPU during work hours which seems like primetime for a virus scan.

I intend this to be a living document, I have included suggestions from peoples' replies.

@halfbyte
halfbyte / lednet.cpp
Created November 29, 2013 22:43
Arduino experiment to drive some DIODER from IKEA via OSC by using an Arduino and a small ruby script.
#include <SPI.h>
#include <Dhcp.h>
#include <Dns.h>
#include <Ethernet.h>
#include <EthernetClient.h>
#include <EthernetServer.h>
#include <EthernetUdp.h>
#include <util.h>
// color swirl! connect an RGB LED to the PWM pins as indicated
user jessed staff;
worker_processes 2;
events {
worker_connections 1024;
}
http {
include mime.types;
@sowawa
sowawa / sinachiku.rb
Created June 18, 2012 07:00 — forked from mattn/sinachiku.rb
sinatra on mruby
require 'HTTP'
require 'UV'
module Sinachiku
@routes = { 'GET' => [], 'POST' => [] }
def self.route(method, path, opts, &block)
@routes[method] << [path, opts, block]
end
def self.do(r)
@routes[r.method].each {|path|
@alexstubbs
alexstubbs / sphinx.rb
Created April 17, 2012 10:28
Brew formula for install sphinx 0.9.8.1 based on homebrew formula sphinx 2.0.4 git checkout 8dbb32e /usr/local/Library/Formula/sphinx.rb
require 'formula'
class Libstemmer < Formula
# upstream is constantly changing the tarball,
# so doing checksum verification here would require
# constant, rapid updates to this formula.
head 'http://snowball.tartarus.org/dist/libstemmer_c.tgz'
homepage 'http://snowball.tartarus.org/'
end
@marcel
marcel / gist:2100703
Created March 19, 2012 07:24
giftube – Generates an animated gif from a YouTube url.
#!/usr/bin/env ruby
# giftube – Generates an animated gif from a YouTube url.
#
# Usage:
#
# giftube [youtube url] [minute:second] [duration]
#
# ex.
#