Skip to content

Instantly share code, notes, and snippets.

View michaelglass's full-sized avatar
🐡
I HAVE A LOT OF MARSHMALLOWS IN MY MOUTH

Michael Glass michaelglass

🐡
I HAVE A LOT OF MARSHMALLOWS IN MY MOUTH
View GitHub Profile
@michaelglass
michaelglass / README
Created January 10, 2024 11:59 — forked from jmatsushita/README
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
@michaelglass
michaelglass / obsidian-daily-note-template.txt
Created August 23, 2023 06:01 — forked from dannberg/obsidian-daily-note-template.txt
Dann Berg's Daily Note Template for Obsidian. Uses Dataview & Templater plugins. Should be saved as a Markdown file in Obsidian. Read the full tour: https://dannb.org/blog/2022/obsidian-daily-note-template/
---
created: <% tp.file.creation_date() %>
---
tags:: [[+Daily Notes]]
# <% moment(tp.file.title,'YYYY-MM-DD').format("dddd, MMMM DD, YYYY") %>
<< [[<% fileDate = moment(tp.file.title, 'YYYY-MM-DD-dddd').subtract(1, 'd').format('YYYY-MM-DD-dddd') %>|Yesterday]] | [[<% fileDate = moment(tp.file.title, 'YYYY-MM-DD-dddd').add(1, 'd').format('YYYY-MM-DD-dddd') %>|Tomorrow]] >>
---
#!/bin/bash
set -euo pipefail
# uncomment to debug
# set -x
echo "1️⃣. Does catalina know to create the nix directory?"
if ! grep nix /etc/synthetic.conf > /dev/null 2>&1; then
echo "nix missing from /etc/synthetic.conf. Adding it (will request sudo)"
echo "nix" | sudo tee -a /etc/synthetic.conf > /dev/null
import sublime_plugin
import os
class RemoteTouch(sublime_plugin.EventListener):
def on_post_save(self, view):
file_name = view.file_name()
needle = "PATH_FOR_YOUR_APP" # change this
if needle in file_name:
project_root = view.window().folders()[0]
relative_path = file_name.replace(project_root + '/', "")
@michaelglass
michaelglass / Coffeescript ctags
Last active December 15, 2015 05:39 — forked from Gonzih/Coffeescript ctags
allow for default assignment in constructor
--langdef=coffee
--langmap=coffee:.coffee
--regex-coffee=/(^|=[ \t])*class ([A-Za-z]+\.)*([A-Za-z]+)( extends [A-Za-z_.]+)?$/\3/c,class/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?@?([A-Za-z_.]+):.*[-=]>.*$/\3/m,method/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?([A-Za-z_.]+)[ \t]+=.*[-=]>.*$/\3/f,function/
--regex-coffee=/^[ \t]*([A-Za-z_.]+)[ \t]+=[^->\n]*$/\1/v,variable/
--regex-coffee=/^[ \t]*@([A-Za-z_.]+)[ \t]+=[^->\n]*$/\1/f,field/
--regex-coffee=/^[ \t]*@([A-Za-z_.]+):[^->\n]*$/\1/f,static field/
--regex-coffee=/^[ \t]*([A-Za-z_.]+):[^->\n]*$/\1/f,field/
# Redis
God.watch do |w|
w.name = "redis"
w.interval = 30.seconds
w.start = "/etc/init.d/redis start"
w.stop = "/etc/init.d/redis stop"
w.restart = "/etc/init.d/redis restart"
w.start_grace = 10.seconds
w.restart_grace = 10.seconds