Skip to content

Instantly share code, notes, and snippets.

View ntodd's full-sized avatar

Nate Todd ntodd

  • Pixel Authority
View GitHub Profile
@ntodd
ntodd / nomic-embed-text-v1-bumblebee.livemd
Last active February 6, 2024 16:10
Generate embeddings with nomic-embed-text-v1 using Elixir Bumblebee

nomic-embed-text-v1 Embeddings

Mix.install([
  {:bumblebee, "~> 0.4.2"},
  {:nx, "~> 0.6.1"},
  {:exla, "~> 0.6.1"}
])

Nx.global_default_backend({EXLA.Backend, client: :host})
@ntodd
ntodd / http_client.ex
Created March 2, 2023 19:39
Req HTTPClient for Elixir AWS package
defmodule MyApp.AWS.HTTPClient do
@moduledoc """
Implements the `AWS.HTTPClient` behaviour for use with the `AWS` library.
This is a simple wrapper around the `Req` library. Helps us avoid having to
include Hackney as a dependency.
"""
@behaviour AWS.HTTPClient
@ntodd
ntodd / components.thingy-majigger.js
Created August 24, 2015 01:52
Range binding test
import Ember from 'ember';
export default Ember.Component.extend({
total: 20.0,
current: 4.5,
log: [],
progress: Ember.computed('total', 'current', {
get() {
@ntodd
ntodd / components.video-controls.js
Created August 21, 2015 19:51
Video Player Test
import Ember from 'ember';
export default Ember.Component.extend({
classNames: 'video-controls video-layer'.w(),
hidden: false,
actions: {
togglePlayback: function() {
this.sendAction('togglePlayback');

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
# DOES NOT WORK
test 'authenticate with valid authentication token key and do not store if stateless and timeoutable are enabled' do
swap Devise, :token_authentication_key => :secret_token, :stateless_token => true do
user = sign_in_as_new_user_with_token
assert warden.authenticated?(:user)
get expire_user_path(user)
get_users_path_as_existing_user(user)
assert warden.authenticated?(:user)
<!-- ============================================================== -->
<!-- = Code Snippets from Mobile Webkit Development Talk on 11/16 = -->
<!-- ============================================================== -->
<!-- =========================== -->
<!-- = Conditional Stylesheets = -->
<!-- =========================== -->
<link media="only screen and (max-device-width: 480px)" href="small-device.css" type= "text/css" rel="stylesheet">