Skip to content

Instantly share code, notes, and snippets.

@bzerangue
bzerangue / debian-home-assistant-supervised_instructions.md
Last active December 5, 2024 00:25
[DEPRECATED] Installing Debian + Home Assistant Supervised
@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) {