Skip to content

Instantly share code, notes, and snippets.

View jeffcogswell's full-sized avatar

Jeffrey Cogswell jeffcogswell

View GitHub Profile
@jeffcogswell
jeffcogswell / create_csharp_program_class.md
Created October 23, 2023 19:00
Create C# console app in command line with Program Class

How to use the dotnet command line to create a C# app with the program class like the good old days

dotnet new console --use-program-main

@jeffcogswell
jeffcogswell / chroma_sample.py
Last active August 24, 2023 21:10
chromadb example
import os
import chromadb
chroma_client = chromadb.Client()
collection = chroma_client.create_collection(name="wiki")
def load_txt_files(directory):
txt_files = []
names = []
@jeffcogswell
jeffcogswell / git_credential_mgr_wsl2.md
Last active March 19, 2024 20:28
Git Credential Manager Core in WSL2

I'll add more to this later but for now:

Find out how I have it set in regular Windows from the command prompt:

git config --list

Output:

... etc
@jeffcogswell
jeffcogswell / cr.snippet
Created May 2, 2022 18:14
ReadLine snippet for VS
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>cr</Title>
<Shortcut>cr</Shortcut>
<Description>Code snippet for Console.ReadLine</Description>
<Author>*Not* Microsoft Corporation</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
@jeffcogswell
jeffcogswell / app.js
Created October 5, 2017 01:37
CraZySacX/node-jdbc with hive JDBC driver in node.js
// Uses https://github.com/CraZySacX/node-jdbc
// Assumes you have already installed the JDK, hadoop, and hive!
// Just a quick demo with callback hell... Really you'll
// want to use async or something similar...
var JDBC = require('jdbc');
var jinst = require('jdbc/lib/jinst');
jinst.setupClasspath([
'/usr/local/hadoop/share/hadoop/common/hadoop-common-2.7.4.jar',
'/usr/local/apache-hive-1.2.2-bin/lib/hive-jdbc-1.2.2-standalone.jar'
])
@jeffcogswell
jeffcogswell / SciTEGlobal.properties
Created June 20, 2017 15:20
scite global properties - just my own minor customizations for linux
# Global initialisation file for SciTE
# For Linux, place in $prefix/share/scite
# For Windows, place in same directory as SciTE.EXE (or Sc1.EXE)
# Documentation at http://www.scintilla.org/SciTEDoc.html
# Globals
# Window sizes and visibility
if PLAT_WIN
position.left=0
@jeffcogswell
jeffcogswell / org_ally1_bus_fix.md
Last active May 30, 2024 08:49
Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus ...

Seeing this error in the bash shell when launching some apps, such as scite:

** (scite:5298): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files

Update as per comments below.

It appears adding this library fixes the problem: at-spi2-core

@jeffcogswell
jeffcogswell / geany_gtk_dark.md
Last active November 4, 2021 17:16
Example of making the GTK widgets dark in Geany without changing the whole environment

It turns out you can have separate GTK rc files for separate apps, just by setting an environment variable. For this example I'm using this theme: https://github.com/axxapy/Adwaita-dark-gtk2

First, clone the GTK theme you want into a directory such as ~/.config/geany/gtk

mkdir ~/.config/geany/gtk2/
cd ~/.config/geany/gtk2/
git clone [email protected]:axxapy/Adwaita-dark-gtk2.git

That's it. You only have to do that part once. Now any time you run geany, just set an environment variable first, like so:

@jeffcogswell
jeffcogswell / settings.ini
Created September 15, 2016 17:57
GTK settings on Lubuntu - put in /home/jeff/.config/gtk-3.0
[Settings]
gtk-theme-name=Clearlooks
gtk-icon-theme-name=Super Flat Remix
gtk-font-name=Liberation Sans 11
gtk-cursor-theme-name=DMZ-White
gtk-cursor-theme-size=18
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=1
gtk-menu-images=1
@jeffcogswell
jeffcogswell / lubuntu-rc.xml
Created September 15, 2016 17:50
openbox configuration - goes in /home/jeff/.config/openbox
<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not edit this file, it will be overwritten on install.
Copy the file to $HOME/.config/openbox/ instead. -->
<openbox_config xmlns="http://openbox.org/3.4/rc" xmlns:xi="http://www.w3.org/2001/XInclude">
<resistance>
<strength>10</strength>
<screen_edge_strength>20</screen_edge_strength>
</resistance>
<focus>
<focusNew>yes</focusNew>