Skip to content

Instantly share code, notes, and snippets.

View cameronsjo's full-sized avatar

Cameron Sjo cameronsjo

View GitHub Profile
@cameronsjo
cameronsjo / sync-claude.sh
Last active February 22, 2026 02:50
Sync Claude Code environment — pull config, install plugins, clean cache
#!/bin/bash
# Install and sync Claude Code plugins from public marketplaces
#
# Registers marketplaces, updates them, installs plugins, and enables them.
# Idempotent — safe to re-run anytime.
#
# Usage:
# curl -fsSL <gist-raw-url>/sync-claude.sh | bash
#
# Prerequisites:
@cameronsjo
cameronsjo / corgi-error-pages.html
Created February 13, 2026 19:28
Corgi error pages — all 6 themed pages (403/404/500/502/503/504) with full animations
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Corgi Error Pages</title>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Outfit:wght@300;500;700&display=swap" rel="stylesheet">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #0a0a0f; font-family: Outfit, sans-serif; color: #e8eaed; }
@cameronsjo
cameronsjo / RSAKeys.cs
Created July 3, 2019 13:15 — forked from ststeiger/RSAKeys.cs
Import and export RSA Keys between C# and PEM format using BouncyCastle
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.OpenSsl;
using Org.BouncyCastle.Security;
using System;
using System.IO;
using System.Security.Cryptography;
namespace MyProject.Data.Encryption
{
@cameronsjo
cameronsjo / gist:ca14ca4e64a8f389742d731feab8940a
Created March 25, 2019 13:40 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
var weights = new [] {
new {Desc = "A", Weight = 40},
new {Desc = "B", Weight = 25},
new {Desc = "B1", Weight = 20},
new {Desc = "C", Weight = 3},
new {Desc = "D", Weight = 1},
new {Desc = "E", Weight = 1},
new {Desc = "F", Weight = 10}
};
@cameronsjo
cameronsjo / JsonResult.cs
Last active October 31, 2016 15:59
Class for generating standardized JSON API responses in C#.
using Newtonsoft.Json;
/// <summary>
/// This is a slightly modified C# implementation of the JSON API format.
/// Documentation is available here: http://jsonapi.org/format/
/// </summary>
public class JsonResult
{
/// <summary>
public static class Base32
{
public static byte[] ToBytes(string input)
{
if (string.IsNullOrEmpty(input))
{
throw new ArgumentNullException("input");
}
input = input.TrimEnd('='); //remove padding characters
# http://stackoverflow.com/a/10472358/2607840
Function Get-ProjectReferences ($rootFolder)
{
$projectFiles = Get-ChildItem $rootFolder -Filter *.csproj -Recurse
$ns = @{ defaultNamespace = "http://schemas.microsoft.com/developer/msbuild/2003" }
$projectFiles | ForEach-Object {
$projectFile = $_ | Select-Object -ExpandProperty FullName
$projectName = $_ | Select-Object -ExpandProperty BaseName
$projectXml = [xml](Get-Content $projectFile)
@cameronsjo
cameronsjo / gist:06e435e298f6a873d8518cd4d1a64127
Created August 10, 2016 20:18 — forked from rarous/gist:3529050
Generate MetaProj file from solution
$env:MSBuildEmitSolution=1
msbuild FooBar.sln /t:ValidateSolutionConfiguration
$env:MSBuildEmitSolution=0
async Task Main()
{
var checkoutQueue = new System.Collections.Concurrent.BlockingCollection<string>(new ConcurrentQueue<string>());
var searchQueue = new System.Collections.Concurrent.BlockingCollection<string>(new ConcurrentQueue<string>());
var queues = new
{
Checkout = checkoutQueue,
Search = searchQueue
};