Skip to content

Instantly share code, notes, and snippets.

View dan-palmer's full-sized avatar
👨‍💻

Dan Palmer dan-palmer

👨‍💻
View GitHub Profile
@dan-palmer
dan-palmer / prompt.json
Created February 2, 2024 13:49
Arc Search Browse for Me Prompt
{
"messages": [
{
"content": "You are an advanced, reliable, candid AI system that takes user search queries, converts them into questions, and answers them, using specific facts and details sourced from webpages to prove your answer. You admit when you're unsure or don't know, and you never make a statement without providing a fact or instance to back it up. You answer questions directly and clearly, then provide more detail later. You follow the JSON schema exactly.",
"role": "system"
},
{
"content": "# CONTEXT\nCurrent date: #{DATE_TIME}.\n\nHere are result from a web search for '#{QUERY}':\nBEGIN WEB PAGE #{HOST_1} #{MARKDOWN_1}END WEB PAGE\nBEGIN WEB PAGE #{HOST_2} #{MARKDOWN_2}END WEB PAGE\nBEGIN WEB PAGE #{HOST_3} #{MARKDOWN_3}END WEB PAGE\nBEGIN WEB PAGE #{HOST_4} #{MARKDOWN_4}END WEB PAGE\nBEGIN WEB PAGE #{HOST_5} #{MARKDOWN_5}END WEB PAGE\nBEGIN WEB PAGE #{HOST_6} #{MARKDOWN_6}END WEB PAGE",
"role": "system"
},
@dan-palmer
dan-palmer / swap-commands.txt
Created July 10, 2012 09:24
Enable Disable OSX Swap etc
# check swap usage
sysctl vm.swapusage
# disable encrypted swap - SNOW LEOPARD
sudo defaults write /Library/Preferences/com.apple.virtualMemory UseEncryptedSwap -boolean no
# disable encrypted swap - LION
sudo defaults write /Library/Preferences/com.apple.virtualMemory DisableEncryptedSwap -boolean yes
# disable swap
require 'minitest/autorun'
# This should pass..
describe 'Immutable prison data' do
let(:prison_name) { 'Wandsworth' }
def test_data_is_treated_immutable
prison1 = Prison.find prison_name
@dan-palmer
dan-palmer / example.js
Created January 2, 2024 11:16
Node Axios Teller Client Example
const fs = require('fs');
const https = require('https');
const axios = require('axios');
const httpsAgent = new https.Agent({
cert: fs.readFileSync('/path/to/your/certificate.pem'),
key: fs.readFileSync('/path/to/your/private_key.pem'),
});
const username = "token_foobarbaz" // the authorization token returned by Teller Connect
unless File.exists?("~/.todos/"), do: File.mkdir!("~/.todos/")
case System.argv() do
["all"] ->
if (files = File.ls!("~/.todos/")) == [],
do: IO.puts("No todos."),
else: Enum.each(files, &IO.puts("- #{&1}\n#{File.read!("#{"~/.todos/"}#{&1}")}\n"))
["create", todo] ->
File.write!("#{"~/.todos/"}#{:os.system_time(:second)}", todo) && IO.puts("📝")
defmodule Mix.Tasks.Todo do
use Mix.Task
@dir "~/.todos/"
def run(args) do
unless File.exists?(@dir), do: File.mkdir!(@dir)
case args do
["all"] ->
case File.ls!(@dir) do

Teller Bank Challenge

Mix.install([:req, :jason, :kino])

Your Solution

@dan-palmer
dan-palmer / require-js-dep-arrays-vs-node-style.coffee
Created November 25, 2013 23:41
Managing RequireJS Dependency Arrays
## Managing RequireJS Dependency Arrays
define ['jQuery','Backbone','Handlebars','AModel'], ($, _, Backbone, HB, AModel) ->
...
## VERSUS Node style requires..
define (require) ->
$ = require 'jQuery'
Backbone = require 'Backbone'
@dan-palmer
dan-palmer / Gruntfile.coffee
Last active December 29, 2015 08:59
Example Grunt File for Watching & Compiling .coffee files in a project
sourceFiles = [ '*.coffee', 'models/*.coffee', 'views/*.coffee' ]
fullPathSourceFiles = sourceFiles.map (f) -> "app/coffee/" + f
fullPathSpecFiles = sourceFiles.map (f) -> "specs/coffee/" + f
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
watch:
coffee:
files: fullPathSourceFiles.concat(fullPathSpecFiles)
@dan-palmer
dan-palmer / springer-free-maths-books.md
Created December 28, 2015 16:35 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links