Skip to content

Instantly share code, notes, and snippets.

View alicraigmile's full-sized avatar

Ali Craigmile alicraigmile

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<title>BBC Bitesize</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
@alicraigmile
alicraigmile / lsbackup
Last active May 28, 2021 15:19
lsbackup
#!/bin/bash
################################################################################
# Variables
################################################################################
# Credit variables
MY_NAME="lsbackup"
MY_DESC="How old are the backups held on this machine?"
MY_PROJ="https://gist.github.com/alicraigmile/acf73eaaf4e0c774854ff4d08f46842e"
@alicraigmile
alicraigmile / twister.js
Created May 18, 2020 12:48
We lost the twister spinner thingy so I made one we could cast to the telly instead
var bodyParts = ["Left hand ✋","Right hand ✋", "Left foot 🦶", "Right foot 🦶"];
var colours = ["Green 🍏", "Red 🍎","Yellow 🌻","Blue 🏴󠁧󠁢󠁳󠁣󠁴󠁿"];
var getRandomInt = function(max) {
return Math.floor(Math.random() * Math.floor(max));
}
var clearScreen = function() {
document.open();
document.close();
}
spin = function() {
#https://www.raspberrypi.org/blog/video-wall/
Server with the video
vlc.exe -vvv VIDEO (h.264) –sout udp:225.0.0.1:1234 –ttl 1 –loop
Raspberry as client (sync-master)
vlc.exe udp://@225.0.0.1:1234 –vout-filter wall –wall-cols X –wall-rows Y –wall-active SCREEN_ID –control netsync –netsync-master -f
Raspberry as Client (sync slave)
vlc.exe udp://@225.0.0.1:1234 –vout-filter wall –wall-cols X –wall-rows Y –wall-active SCREEN_ID(left-up corner = 0) –control netsync –netsync-master-ip IP-Sync-Master -f
@alicraigmile
alicraigmile / bookmarklet
Created October 21, 2016 15:37
promoted tweets be gone
javascript: (function () { var style = document.createElement('style'); style.type = 'text/css'; style.innerHTML = '.promoted-tweet { display: none; }'; document.getElementsByTagName('head')[0].appendChild(style); }());
#!/bin/bash
# Scan to PDFs using my Epson Stylus XS125
# Usage: in .bashrc, source scanner.sh
find_scanner () {
scanimage -L -d epson2 | sed -e "s/device \`//" -e "s/'.*//"
}
scan () {
# MacOS Mail.app (or at least Version 7.3 (1878.6), doesn't show you how many results are returned in a search.
# With this script, select the messages you want to count.
#
# by Ali Craigmile <[email protected]>
tell application "Mail"
activate
set sel to selection
set len to length of sel
display dialog "items: " & len
@alicraigmile
alicraigmile / node-localinstall-arm7.sh
Created March 5, 2016 21:21
Script to install node.js locally on an RPi v3 so that jenkins doesn't need to be run as root to install node modules like libxmljs
#!/bin/bash
set -x
# Script: node-localinstall-arm7.sh
# Install node.js locally on an RPi v3 so that jenkins doesn't
# need to be run as root to install node modules like libxmljs
# Author: Ali Craigmile <[email protected]>
# Licence: MIT
# Thanks: http://tnovelli.net/blog/blog.2011-08-27.node-npm-user-install.html
@alicraigmile
alicraigmile / speak-me-the-time.py
Last active August 29, 2015 14:24
Have your raspberry pi speak you the time when you press a (GPIO connected) button.
#!/usr/bin/env python
#https://gist.github.com/alicraigmile/7f5526c8058e35243dba/edit
import RPi.GPIO as GPIO
import time
import os
JOB = "date +'%d %B %I:%M%p' | festival --tts"
LED_PIN = 8
@alicraigmile
alicraigmile / uuidgenlc.sh
Last active August 29, 2015 14:15
New UUID, lower case chararacters
#!/bin/bash
alias uuidgenlc="uuidgen | tr '[:upper:]' '[:lower:]'"