Skip to content

Instantly share code, notes, and snippets.

@bzerangue
bzerangue / debian-home-assistant-supervised_instructions.md
Last active March 26, 2024 22:16
Installing Debian + Home Assistant Supervised

Installing Debian + Home Assistant Supervised (for a linux 64 bit pc intel or amd)

Build a USB installer for Debian (non-free firmware), download the Debian Buster and build usb installer with Balena Etcher

In the Debian installer, uncheck Debian desktop environment and check ssh server and other software modules.

After installing Debian, reboot the machine and login via ssh with the username you created during setup...

Once you have SSH'd from the terminal and have logged into your new Debian machine, run the following command...

@daviddarnes
daviddarnes / index.njk
Created June 1, 2019 08:02
Eleventy blog from API
<h1>API post list</h1>
<ul>
{% for post in posts %}
<li>
<a href="/posts/{{ post.id }}/">{{ post.title }}</a>
</li>
{% endfor %}
</ul>
@nrollr
nrollr / BulkRename.applescript
Last active December 9, 2021 14:33
Bulk rename files with csv file
-- Store the .csv file in the same directory as the files you wish to rename
-- Replace 'username' in the path with your own (lines 3 & 10)
set csvFile to "/Users/username/Documents/index.csv"
set csvList to paragraphs of (read csvFile)
set {theID, my text item delimiters} to {my text item delimiters, ","}
repeat with csvLines in csvList
set {oldName, newName} to text items of csvLines
tell application "System Events"
set name of file oldName of folder "/Users/username/Documents/" to newName
@netsensei
netsensei / nasa.xsl
Created September 26, 2015 14:46
Converts XML output of the US GSA Social Media API to CSV - http://registry.usa.gov/accounts.xml?agency_id=nasa
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" />
<xsl:variable name="delimiter" select="','" />
<!-- define an array containing the fields we are interested in -->
<xsl:variable name="fieldArray">
<field>service_id</field>
<field>account</field>
@grncdr
grncdr / data.csv
Created June 17, 2015 22:29
Demo of importing a CSV file into a Contentful space
first name last name age
Stephen Sugden 31
Tom Reznik 29
Justin Thomas 30
@tmos
tmos / wpmd 2 grav
Last active May 1, 2018 19:19
This script converts the headers from wp2md to Grav headers format
#! /bin/bash
#####################################################################################################
# == wpmd 2 grav == #
# This script converts the headers from wp2md to Grav headers format #
# wp2md : https://github.com/dreikanter/wp2md ; with `wp2md -d ./ export.xml -ps {title}/item.md` #
# Grav : http://getgrav.org/ #
# @author : Tom Canac http://tomcanac.com/ #
# @version : 0.1 #
# @licence : CC-BY #
@nobodyiscertain
nobodyiscertain / example.conf
Last active August 29, 2015 14:05
nginx Config for Statamic 1.8.2
server {
server_name example.com;
root /var/www/example.com/public;
index index.php;
access_log /var/www/example.com/logs/access.log;
error_log /var/www/example.com/logs/error.log;
add_header "X-Built-With" "Statamic";
@wesrice
wesrice / _base.twig
Last active October 2, 2019 18:02
Sample Modular Templating for Craft CMS - Inspired by principles from https://smacss.com/.
<!DOCTYPE html>
<head>
{# Base #}
{% includeCssFile 'layouts/base/css/base.css' %}
{% includeJsFile 'layouts/base/js/base.js' %}
{# Header #}
{% includeCssFile 'modules/header/css/header.css' %}
{% includeJsFile 'modules/header/js/header.js' %}
@budparr
budparr / calendar-for-static-sites.js
Last active August 29, 2015 14:01
A calendar solution for static sites
this is now located at: https://github.com/budparr/jekyll-calendar
// REQUIRES MOMENT.JS AND UNDERSCORE.JS
// This still needs to be templated and cleaned up and commented.
// original idea came from (I think) seattlehacks.com
// you will need to add events via a JSON file
// OR use this YAML to have content people create lists of events https://gist.github.com/budparr/5b21dccf318e723834e9
// use this JSON generator to create JSON for list below https://gist.github.com/budparr/ee901ba06f29cf1db637
var timing = function(start, end) {