Skip to content

Instantly share code, notes, and snippets.

@bzerangue
bzerangue / debian-home-assistant-supervised_instructions.md
Last active December 20, 2022 20:21
Installing Debian + Home Assistant Supervised
View debian-home-assistant-supervised_instructions.md

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
View index.njk
<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
View BulkRename.applescript
-- 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
View nasa.xsl
<?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
View data.csv
first name last name age
Stephen Sugden 31
Tom Reznik 29
Justin Thomas 30
@mralexho
mralexho / setup-dev.sh
Last active March 7, 2022 16:30
Install homebrew, nginx, mysql, php55, and composer on Mac OS X
View setup-dev.sh
#!/bin/bash
# install homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install homebrew's official php tap
brew tap josegonzalez/homebrew-php
@tmos
tmos / wpmd 2 grav
Last active May 1, 2018 19:19
This script converts the headers from wp2md to Grav headers format
View wpmd 2 grav
#! /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
View example.conf
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/.
View _base.twig
<!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' %}