Skip to content

Instantly share code, notes, and snippets.

Avatar
🔧

Malachi Soord inverse

🔧
View GitHub Profile
View gist:a1dd36132c0ccc3ad88581f51331b928
# Turn on the living room lamp every day 10 minutes before sunset.
- alias: "Living Room - Sunset"
trigger:
- platform: sun
event: sunset
offset: "-00:10:00"
action:
- service: yeelight.set_color_scene
data:
entity_id: light.xiaomi_yeelight_rgbw
@inverse
inverse / update.sh
Created Aug 26, 2020
Psalm updater
View update.sh
#!/bin/bash
PACKAGE=psalm
REPO=vimeo/$PACKAGE
if [ "$#" -ne 1 ]
then
echo "Trying ro resolve latest..."
VERSION=$(curl --silent "https://api.github.com/repos/${REPO}/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
View gist:cabf8fbfb15bf3481443d51974841e10
- name: PHP | Install ondrej PPA
apt_repository:
repo: 'ppa:ondrej/php'
state: present
tags: php
- name: PHP | Install packages
apt:
name: '{{ item }}'
state: latest
@inverse
inverse / prepare-commit-msg
Last active Jul 9, 2020
Git hook for adding branch name to commit message if it conforms to ticket naming convention
View prepare-commit-msg
#!/bin/bash
# Prepend branch name to commit message in [] if matching regex. e.g. DEN-123
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"
BRANCH_IN_COMMIT=$(grep -c "\[$BRANCH_NAME\]" $1)
if [ -n "$BRANCH_NAME" ] && [[ $BRANCH_NAME =~ ^([A-Z]+-[0-9]+)(\-.+)?$ ]] && ! [[ $BRANCH_IN_COMMIT -ge 1 ]]; then
@inverse
inverse / update.sh
Last active Oct 9, 2018
Update espurna
View update.sh
#!/bin/bash
declare -a devices=(
""
)
USER=""
PASS=""
# Environment you're deploying
View scraping.js
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({args: ['--no-sandbox'], headless: true});
const page = await browser.newPage();
await page.goto('https://www.bibiblocksberg.de/hoerspiele');
const loadMoreSelector = '.pager__item a';
for(i = 0; i < 6; i++) {
@inverse
inverse / photoProcess.sh
Last active Mar 11, 2018
Process Photos
View photoProcess.sh
#!/bin/bash
# Dependencies
#
# - exiftool (http://www.sno.phy.queensu.ca/~phil/exiftool/)
# - sortphotos (https://github.com/andrewning/sortphotos)
#
if ! [ -x "$(command -v exiftool)" ]; then
echo 'Error: exiftool is not installed.' >&2
View lastfmextra.user.js
// ==UserScript==
// @name Last.fm Extra
// @namespace https://malachisoord.com/
// @version 0.1.3
// @description Provide missing extra functionality to Last.fm
// @author Malachi Soord
// @match http://www.last.fm/*
// @require https://code.jquery.com/jquery-2.2.0.min.js
// @run-at document-idle
// ==/UserScript==
View gist:ba737bd592eb5209b8c5
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
cinst 7zip
cinst 7zip.install
cinst AdobeAIR
cinst adobereader
cinst DotNet4.5.1
cinst filezilla
cinst git
@inverse
inverse / build.xml
Last active Jan 4, 2016
Basic CodeIgniter deployment using Mercurial via SSH.
View build.xml
<project name="deploy" default="help" basedir=".">
<!--
Required properties:
Repo to pull from
- repo
Location to deploy too
- deploy.location