Skip to content

Instantly share code, notes, and snippets.

View newzealandpaul's full-sized avatar

Paul newzealandpaul

View GitHub Profile
@Intyre
Intyre / Wahoo_Elemnt.md
Last active October 1, 2024 08:59
Wahoo Elemnt - Tips, tricks and custom images
@c727
c727 / no-love.html
Created June 22, 2018 17:39
List entities that are not in Home Assistant Lovelace UI
<!--
panel_custom:
- name: no-love
sidebar_title: No love
sidebar_icon: mdi:heart-off
webcomponent_path: /home/bs/.homeassistant/panels/no-love.html
-->
<dom-module id="ha-panel-no-love">
<style>
@edro15
edro15 / ForceUSBtoTTY.md
Last active September 1, 2024 11:00
[How To] Force a specific USB device to a certain TTY

Scenario:

  • multiple USB devices plugged via hub to a host (Linux OS based),
  • multiple services/programs interacting with TTY running on top (e.g. GPSd)

Problem:

At boot TTY are randomly assigned to devices causing depending services/programs instabilities. They could indeed fail to start because of different TTY configurations.

Solution:

@Tithen-Firion
Tithen-Firion / openload.js
Last active November 20, 2021 15:14
Openload: extract download URL using PhantomJS
// Usage: phantomjs openload.js <video_url>
// if that doesn't work try: phantomjs --ssl-protocol=any openload.js <video_url>
var separator = ' | ';
var page = require('webpage').create(),
system = require('system'),
id, match;
if(system.args.length < 2) {
console.error('No URL provided');
@basilfx
basilfx / README.md
Last active May 21, 2023 06:01
OctoPi to Read-only

OctoPi to Read-only

These steps will provide a read-only OctoPi installation while still having a read/write home directory. In other words, as long as you don't have to update system files, this installation will be fully functional.

  • Install OctoPi on a 8GB (or more) SD card and boot it at least once.
  • Mount it with a Linux machine (e.g. Ubuntu).
  • Use sudo gparted and configure the remaining space as EXT4.
  • There are now three partitions. Mount the last two.
  • Move /home/pi to the new and empty partition.
  • Edit /etc/fstab:
#pragma SPARK_NO_PREPROCESSOR
// DS18B20 Thermometer Stuff
#include "DallasTemperature.h"
#include "OneWire/OneWire.h"
#define ONE_WIRE_BUS D1
#define TEMPERATURE_PRECISION 9
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
DeviceAddress inWaterThermometer = { 0x28, 0x2E, 0x54, 0x0A, 0x06, 0x0, 0x0, 0xFB };
@TravelingTechGuy
TravelingTechGuy / ChromeExtensionGulp.js
Created April 5, 2014 19:22
Gulp file for building a Chrome Extension
'use strict';
//npm install gulp gulp-minify-css gulp-uglify gulp-clean gulp-cleanhtml gulp-jshint gulp-strip-debug gulp-zip --save-dev
var gulp = require('gulp'),
clean = require('gulp-clean'),
cleanhtml = require('gulp-cleanhtml'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
stripdebug = require('gulp-strip-debug'),
@jnv
jnv / srt2txt.rb
Last active November 20, 2022 16:11
Converts SRT subtitles to plain text, strips irrelevant parts. Requires gems: srt, sanitize. Created for Doctor Who text analysis project.
#!/usr/bin/env ruby
require "srt"
require "sanitize"
REJECT_LINES = [/Best watched using Open Subtitles MKV Player/,
/Subtitles downloaded from www.OpenSubtitles.org/, /^Subtitles by/,
/www.tvsubtitles.net/, /[email protected]/, /addic7ed/, /allsubs.org/,
/www.seriessub.com/, /www.transcripts.subtitle.me.uk/, /~ Bad Wolf Team/,
/^Transcript by/, /^Update by /, /UKsubtitles.ru/
]
@natritmeyer
natritmeyer / mount_smbfs.sh
Created September 19, 2013 09:40
How to mount and unmount a SMB share on Mac OS X (using mount_smbfs)
#Mounting the share is a 2 stage process:
# 1. Create a directory that will be the mount point
# 2. Mount the share to that directory
#Create the mount point:
mkdir share_name
#Mount the share:
mount_smbfs //username:[email protected]/share_name share_name/
@ddiaz
ddiaz / detect_ie9.js
Created March 7, 2012 14:01 — forked from padolsey/gist:527683
JavaScript: Detect IE9
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}