Skip to content

Instantly share code, notes, and snippets.

View devstopfix's full-sized avatar

James Every devstopfix

View GitHub Profile
@devstopfix
devstopfix / aws_bedrock_llm_outputs.txt
Created January 14, 2024 14:26
AWS Bedrock LLM output
Asking amazon.titan-tg1-large "Who invented the Erlang programming language and in what year?" with temperature=0.0
Erlang was developed by Ericsson in the year 1986.
(1278 ms) ----------
Asking amazon.titan-tg1-large "Who invented the Erlang programming language and in what year?" with temperature=0.8
Erlang was created by Ericsson in the year 1986.
The cargo ship Manilla Voyager is carrying Lemons from Fiji to Paris. The cargo of Lemons poses a danger to the ship because they are poisonous, according to the U.S. Coast Guard.
Lemons are a member of the nightshade family and have been used as a food additive since the 1800s. In recent years, they have gained popularity for their flavor and health benefits.
The Coast Guard is working to determine how many lemons were on board the ship and what their origin is. They will release the information as soon as it is available.
In a study published in the Proceedings of the National Academy of Sciences, researchers found lemons in nearly two-thirds of fish caught off the coast of New Zealand.
Lemons are grown in California and shipped to Europe by sea, where they are processed into limes, which are used to make margaritas and tequila.
@devstopfix
devstopfix / chunk_files.cljs
Created April 22, 2020 15:39
Partition image files into folders based on timestamp.
#!/usr/bin/env plk
(ns chunk.core
(:require [goog.date.UtcDateTime]
[planck.core :refer [*in* line-seq]]
[planck.io :as io]))
;
; Partition image files into folders based on timestamp.
;
; This script takes a list of images produced by a webcamera with motion detection
@devstopfix
devstopfix / ants.clje
Last active May 14, 2020 15:53
Rich Hickey's ants simulator ported to Clojure on the BEAM
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright (c) 2008 Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
; Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
; which can be found in the file CPL.TXT at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; the terms of this license.
; You must not remove this notice, or any other, from this software.
;
; Original Clojure JVM code :- https://gist.github.com/michiakig/1093917
@devstopfix
devstopfix / ants.clj
Last active April 25, 2020 05:31 — forked from michiakig/ants.clj
Clojure ant sim from Rich Hickey
(ns ants.core)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright (c) 2008 Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
; Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
; which can be found in the file CPL.TXT at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; the terms of this license.
; You must not remove this notice, or any other, from this software.
@devstopfix
devstopfix / strings.exs
Created December 3, 2019 10:49
String processing
dataset =
[
[lang: "C", loc: 79, t: {4, :s}, mem: {40, :MB}],
[lang: "Python", loc: 11, t: {4, :s}, mem: {150, :MB}],
[lang: "Ruby", loc: 9, t: {17, :s}, mem: {3, :GB}],
[lang: "Elixir", loc: 11, t: {120, :s}, mem: {700, :MB}],
[lang: "Elixir ETS", loc: 17, t: {40, :s}, mem: {730, :MB}],
[lang: "Elixir Regex", loc: 17, t: {70, :s}, mem: {730, :MB}],
[lang: "Elixir String.split", loc: 11, t: {30, :s}, mem: {730, :MB}],
[lang: "Elixir String.split pre-compiled", loc: 17, t: {29, :s}, mem: {730, :MB}],
@devstopfix
devstopfix / chess960.exs
Created February 24, 2019 17:46
Elixir generator of Chess960 openings
defmodule Chess960 do
@moduledoc """
Generate all 960 starting positions for Chess960
https://en.wikipedia.org/wiki/Chess960#Starting_position_requirements
Run with
elixir chess960.exs
"""
@devstopfix
devstopfix / the_little_typer.exs
Last active January 18, 2019 15:19
Interpreter from Chapter 10 of The Little Typer implemented in Elixir
#! /usr/local/bin/elixir
defmodule TheLittleSchemer do
defmodule Toys do
@moduledoc "Chapter 1"
@doc """
The Law of Null?
The primitive null? is defined only for lists.
@devstopfix
devstopfix / roman.clj
Created March 12, 2017 09:20
Roman Numerals (Clojure)
(ns roman-numerals.roman)
(def digits {\I 1
\V 5
\X 10
\L 50
\C 100
\D 500
\M 1000})
@devstopfix
devstopfix / accrete.cljs
Created February 27, 2017 21:42
Generate a non-semantic version number [1 year day-of-year]
#!/usr/local/bin/planck -cp
(ns accrete
(:require [cljs-time.core :as t]
[cljs-time.format :as f]
[clojure.string :refer [join]]))
(def this-year (-> (t/now) (t/year)))
(defn day-of-year []