Skip to content

Instantly share code, notes, and snippets.

View squalrus's full-sized avatar
🍍
Oh, hello, I didn't notice you there.

Chad Schulz squalrus

🍍
Oh, hello, I didn't notice you there.
View GitHub Profile
@squalrus
squalrus / gist:e2e64be29bd005a435578d3abcfb86bb
Created September 14, 2022 04:56
Delete branches except `main`
git fetch --prune origin #prune remote branches
git branch -r #list remote brnaches
git branch | select-string -NotMatch -Pattern "main" | %{ git branch -D $_.ToString().Trim() }
{
"globalHeaders": {
"content-security-policy": "default-src 'self' https://squalr.us; script-src 'self' https://www.google-analytics.com 'sha256-d8WoQSinwBfvQBSI1cIf68DLqh2eUwA1HYB0xu6gBsA=' https://platform.twitter.com https://gist.github.com; style-src 'self' https://squalr.us/ https://github.githubassets.com 'unsafe-inline'; frame-src https://platform.twitter.com; connect-src https://www.google-analytics.com",
"x-frame-options": "DENY"
}
}
{
"routes": [
{
"route": "/img/*",
"headers": {
"cache-control": "must-revalidate, max-age=15770000"
}
}
],
"globalHeaders": {
git for-each-ref --format '%(refname:short)' refs/heads | ForEach-Object {git branch $_ -d}
@squalrus
squalrus / FindFirst.cs
Created October 15, 2018 21:09
Find first element in a collection
var list = new List<string>
{
"foo",
"bar",
"baz"
};
foreach (var i in list)
{
if (i.Equals(list.First()))
MSBuild.exe /m /p:Configuration=Development acom.sln /t:ACOM_Web /v:n
MSBuild.exe /m /p:Configuration=Release
@squalrus
squalrus / gist:3f82c4579e8e3146295bee14d3dbf4a9
Last active December 6, 2016 20:59
REGEX replace LESS @import statements
FIND: @import[ ]+["|']([\.\/\\]*)variables.d.less["|'];
REPLACE: @import (reference) '$1variables.d.less';
@squalrus
squalrus / MergeCleanup.ps1
Created July 27, 2016 17:29
Cleanup your .orig files
Get-ChildItem -Recurse *.orig | Remove-Item -Verbose
@squalrus
squalrus / FileRename.ps1
Created July 27, 2016 17:26
Rename files matching REGEX
Get-ChildItem | Rename-Item -NewName { $_.Name -replace 'old-text', 'NewText' }
@squalrus
squalrus / process-screens.js
Created July 15, 2016 23:44
Adding Screens and Steps into memory
function Screen() {
this.src = '';
this.steps = [];
}
function Step(name, category, html) {
this.name = name;
this.category = category;
this.html = html;
}