Skip to content

Instantly share code, notes, and snippets.

View greystate's full-sized avatar
:octocat:
Octocatering

Chriztian Steinmeier greystate

:octocat:
Octocatering
View GitHub Profile
@chockenberry
chockenberry / finder_icons.sh
Created March 16, 2023 20:00
Script to toggle Finder icons
#!/bin/sh
defaults read com.apple.finder CreateDesktop > /dev/null 2>&1
enabled=$?
if [ "$1" = "off" ]; then
if [ $enabled -eq 1 ]; then
osascript -e 'tell application "Finder" to quit'
defaults write com.apple.finder CreateDesktop false
open -a Finder
@chockenberry
chockenberry / AttributedString.swift
Created June 1, 2022 21:08
A playground that shows how to use Swift's AttributedString with Markdown
import UIKit
import Foundation
// NOTE: This playground shows how to use Swift's AttributedString with Markdown.
//
// This code was used to display Markdown content in the Tot iOS Widget <https://tot.rocks>
// MARK: - Helpful Links
// NOTE: The following links helped me figure this stuff out.
@monkeydom
monkeydom / ks_changeset.sh
Created May 3, 2022 08:13
Script to put 2 folders into a single changeset git and diff it using ksdiff to see the changeset nicely
#!/bin/sh
# ks_changeset v0.9 - 2022-05-03
# Enable "safe" mode - see http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
if [[ $# -lt 3 ]]; then
echo "Usage: ks_changeset.sh <FolderA> <FolderB> <DestinationGit>"
public class MovieSerivce : IMovieService
{
private readonly IAppPolicyCache _runtimeCache;
private const string MOVIES_CACHE_KEY = "Movies.API.Cache";
public MovieSerivce(AppCaches appCaches)
{
_runtimeCache = appCaches.RuntimeCache;
}
@huytd
huytd / wordle.md
Last active May 2, 2024 12:13
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@chockenberry
chockenberry / Fix Terminal Windows.scpt
Created January 23, 2022 22:33
Fix Terminal Windows
tell application "Terminal"
set ws to windows
if (true) then -- set to false to see current window positions
set c to 80
set ps to {{4215, 27}, {3629, 27}, {3043, 27}, {3043, 734}, {2457, 734}, {3629, 734}, {4215, 734}}
set r to 48
set ix to 1
repeat with p in ps
set w to item ix of ws
@chockenberry
chockenberry / tot.sh
Last active October 6, 2023 12:23
A shell script for Tot
#!/bin/sh
basename=`basename $0`
if [ -z "$*" ]; then
echo "usage: ${basename} <dot> [ -o | -r | <file> | - ]"
echo ""
echo "options:"
echo " -o open dot in window with keyboard focus"
echo " -r read contents of dot"
@kspeeckaert
kspeeckaert / pdf_toc_to_opml.py
Last active September 16, 2019 11:07
Extract the table of contents from a PDF file and save it as an OPML, e.g. for import into a mind map
# Requirements
# yattag==1.12.2
# PyPDF2==1.26.0
# Tested with Python 3.7.4 on macOS
import sys
from pathlib import Path
@sebastiandammark
sebastiandammark / instagram.cshtml
Created September 10, 2019 09:45
Manual Instagram integration on Umbraco
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage<MemberWebsite>
@using Skybrud.Social.Instagram
@using Skybrud.Social.Instagram.Objects
@using Skybrud.Social.Instagram.Responses
@using Skybrud.Social.Umbraco.Instagram.PropertyEditors.OAuth
@{
var rootPage = Model.Content.AncestorsOrSelf<MemberWebsite>().First();
var deactivated = Model.Content.DeactivateInstagram;
var count = 1;
[alias]
cleanup = !git branch --merged master | grep -v '^[ *]*master$' | xargs -r git branch -d