Skip to content

Instantly share code, notes, and snippets.

View jimwhite's full-sized avatar

Jim White jimwhite

View GitHub Profile
@jimwhite
jimwhite / gist:7866da091ddd56e5ba4a485a0295f7da
Last active October 31, 2023 23:06
Bard's code naming style guide
When naming variables in code, you can follow these best practices:
Descriptive: Choose names that are easy to remember.
Concise: Use clear and concise names.
A longer name needs to earn its length vs a shorter one by being more informative.
Lowercase: Use lowercase letters.
Underscores: Use underscores to separate words in a name.
No spaces: Avoid using spaces in names.
No special characters: Avoid using special characters.
No acronyms: Avoid using acronyms and abbreviations.
No conflicts: Avoid names that could be confused with keywords or built-in functions.
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
namespace Shape.Lib
{
internal class Utils
{
public static Func<int?, dynamic> CreateDynamicColorSelector(Func<dynamic> defaultColorSelector, Func<int?, dynamic> customColorSelector) { dynamic colorSelector(int? v) { if (v == null) { return defaultColorSelector(); } return customColorSelector(v); } return colorSelector; }
@jimwhite
jimwhite / rule_one_image_descriptions.txt
Created July 16, 2023 03:52
ChatGPT image descriptions for Hacker Dojo Rule #1
Sure, here are some creative prompts that you could use to generate images or videos for the Hacker Dojo's motto "RULE# 1: BE EXCELLENT TO EACH OTHER."
1. "An intricately designed digital circuit board where the circuits spell out 'RULE# 1: BE EXCELLENT TO EACH OTHER'."
2. "A group of diverse people, representing different ethnicities, genders, and ages, all working together on a complex tech project. Superimposed above them are glowing, futuristic letters stating 'RULE# 1: BE EXCELLENT TO EACH OTHER'."
3. "A large, welcoming entrance to a modern, industrial-style building labeled 'Hacker Dojo'. Above the entrance, in bold neon lights, shines the phrase 'RULE# 1: BE EXCELLENT TO EACH OTHER'."
4. "A pair of hands typing on a keyboard with binary code streaming from it. The binary code transforms into the words 'RULE# 1: BE EXCELLENT TO EACH OTHER'."
#!/bin/bash
find /input_files ! -regex '/input_files/_exceptions.*' -print | head -n 1000 >/outputs/filelist.txt
skilldb % python skilldb.py
No embedding_function provided, using default embedding function: DefaultEmbeddingFunction https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2
hhh: agent_executor.run...
> Entering new AgentExecutor chain...
hhh: SkilledAgent...
{
"tasks": [
{
@jimwhite
jimwhite / llm_jokes.html
Created April 20, 2023 14:10
GPT-4: Be my web site coder. Please generate 10 funny jokes about LLMs and put them in a HTML page with suitable title and a button that shows a random joke from those 10 when pressed.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LLM Laughs: Hilarious Jokes About Large Language Models</title>
<style>
body {
font-family: Arial, sans-serif;
}
@jimwhite
jimwhite / MultipleIteratorDemo.groovy
Last active August 29, 2015 14:12
PoC for iterating over multiple collections in Groovy
// Example of an iterator that works over a sequence of multiple collections.
def a = [1, 2]
def b = [3, 4]
def c = new CollectionSequence(a, b)
// The elements of the collections look like one concatenated list.
println (c as List)
// Mutating the elements of one of the collections changes what we get.
@jimwhite
jimwhite / SomeBean.groovy
Last active August 29, 2015 14:12
Example of using a BeanInfo class for custom getter/setter names for Groovy properties.
class SomeBean {
private String _memo
String foo() { _memo }
void foo(String v) { _memo = v }
public static void main(String[] args) {
SomeBean bean = new SomeBean();
bean.foo = 'bar'
println bean.foo
#!/bin/bash
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/
# Install stuff #
#################
# Install development tools and some misc. necessary packages
yum -y groupinstall "Development tools"
yum -y install tar python-setuptools # Not included in Minimal group and Base is huge.
package org.ifcx.snippets;
/**
* Created by jim on 9/13/14.
*/
public class Foo {
protected int x;
int getX() { return x + 1; }
}