Skip to content

Instantly share code, notes, and snippets.

View jeffcogswell's full-sized avatar

Jeffrey Cogswell jeffcogswell

View GitHub Profile
@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 / 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 / org_ally1_bus_fix.md
Last active April 23, 2023 01:10
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 / q_example.js
Last active August 12, 2022 01:22
Here's another chaining example on using q.js. This doesn't have any error handling, as I just want to demonstrate the chaining concept. Please read the comments carefully, as I start out with a non-q example, to show the order of flow. Please post comments if there's anything that isn't clear and I'll try to revise it as needed.
// Q sample by Jeff Cogswell
/*===========
We want to call these three functions in sequence, one after the other:
First we want to call one, which initiates an ajax call. Once that
ajax call is complete, we want to call two. Once two's ajax call is
complete, we want to call three.
BUT, we don't want to just call our three functions in sequence, as this quick
@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 / 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 git@github.com: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 / 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 / Update_Java_Alternatives.md
Last active August 2, 2020 16:33
Update Alternatives for Java