This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# The script automatically switches the DNS servers between Pi-hole and Cloudflare based on Pi-hole DNS Server status. | |
TARGET=192.168.0.7 # Pi-hole | |
FALLBACK_A=1.1.1.1 # Cloudflare | |
FALLBACK_B=1.0.0.1 # Cloudflare | |
function set_fallback_dns() { | |
echo $(date) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check this image, with all the buttons etc. | |
// https://s3.amazonaws.com/ext.agencewebdiffusion.com/Daniel/APCmini-vMix.PNG | |
// these are the available colors | |
var OFF = 0; | |
var GREEN = 1; | |
var GREEN_BLINK = 2; | |
var RED = 3; | |
var RED_BLINK = 4; | |
var YELLOW = 5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Photos | |
import AVFoundation | |
func ALAssetToPHAsset(asset:ALAsset) -> PHAsset { | |
var fetchOptions: PHFetchOptions = PHFetchOptions() | |
var url:NSURL = asset.valueForProperty(ALAssetPropertyAssetURL) as! NSURL | |
let fetchResult:PHFetchResult = PHAsset.fetchAssetsWithALAssetURLs([url], options: fetchOptions) | |
return fetchResult.firstObject as! PHAsset | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// SendEmailWithAttachment | |
// | |
// Created by Kelly Egan on 3/17/15. | |
// Copyright (c) 2015 Kelly Egan. All rights reserved. | |
// | |
import UIKit | |
import MessageUI |
This is what we did to setup a few dashboards at platanus
- Raspberry Pi
- Dashing Service
- Wifi stick (optional)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Script to import tumblr posts into local markdown posts ready to be consumed by Jekyll. | |
# Inspired by New Bamboo's post http://blog.new-bamboo.co.uk/2009/2/20/migrating-from-mephisto-to-jekyll | |
# Supports post types: regular, quote, link, photo, video and audio | |
# Saves local copies of images | |
require 'rubygems' | |
require 'open-uri' | |
require 'nokogiri' |
Sometimes you want to have a subdirectory on the master
branch be the root directory of a repository’s gh-pages
branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master
branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist
.
Remove the dist
directory from the project’s .gitignore
file (it’s ignored by default by Yeoman).
NewerOlder