Skip to content

Instantly share code, notes, and snippets.

View micahwalter's full-sized avatar
👋

Micah Walter micahwalter

👋
View GitHub Profile
package main
import (
"bufio"
"fmt"
"os"
)
func stringPrompt(label string) string {
resp, err := svc.InvokeModel(context.TODO(), &bedrockruntime.InvokeModelInput{
Accept: &accept,
ModelId: &modelId,
ContentType: &contentType,
Body: []byte(string(payloadBody)),
})
func stringPrompt(label string) string {
var s string
r := bufio.NewReader(os.Stdin)
for {
fmt.Fprint(os.Stderr, label+" ")
s, _ = r.ReadString('\n')
if s != "" {
break
@micahwalter
micahwalter / base58.sql
Created October 7, 2014 22:47
base58.sql
DELIMITER $$
CREATE FUNCTION base58_encode (num bigint(64)) RETURNS varchar(255)
DETERMINISTIC
BEGIN
DECLARE alphabet varchar(255);
DECLARE base_count int DEFAULT 0;
DECLARE encoded varchar(255);
DECLARE divisor DECIMAL(10,4);
/*
Rotary Phone Dial Reader
This sketch reads out the number dialed on a rotary phone dial.
The rotary dial has two signals:
1) turns ON when the wheel is turning
2) pulses a count based on the number dialed.
The results are printed to the serial monitor.
@micahwalter
micahwalter / lib_rest.php
Last active August 4, 2020 16:23
library for calling a soap and rest api with php
<?php
loadlib("http");
#################################################################
function rest_call($method, $more=array()){
$defaults = array(
'request_method' => 'GET',
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
### code to make rest calls to the Tessitura API
import requests
import json
import base64
import os
## Tessitura API
hostName = os.environ['TESSITURA_API']
const http = require('http');
const path = require('path');
const express = require('express');
const translate = require('moji-translate');
const app = express();
app.use(express.static(path.join(__dirname, '')));
app.set('views', './views')
app.set('view engine', 'pug')
@micahwalter
micahwalter / oauth
Created January 16, 2013 05:41 — forked from codingjester/oauth
#!/usr/bin/env python
import oauth2 as oauth
import urlparse
import urllib
consumer_key = '<your-key-here>'
consumer_secret = '<your-secret-key-here>'
request_token_url = 'http://www.tumblr.com/oauth/request_token'