Skip to content

Instantly share code, notes, and snippets.

@kmlawson
kmlawson / dragon.sh
Last active October 13, 2019 15:01
Creates a simple command line interface to openseadragon, making use of dezoom.sh
# This is a wrapper for: https://github.com/lovasoa/dezoom.sh
# Running that command can be tedious if you have a regular URL pattern from openSeaDragon,
# such as the NLA format: https://nla.gov.au/[some image id]/dzi?tile=14/44_38.jpg
# Running this will prompt you for the url pointing to the highest X_Y tile and will
# then construct the appropriate dezoom.sh command using -X and -Y parameters
# it assumes you have wget and ImageMagick installed, and that the dezoom.sh file
# is in the same directory.
echo Paste in the highest tile on zoom level 14:
read fullurl
@dideler
dideler / bot.rb
Last active July 15, 2024 06:56
Sending a notification message to Telegram using its HTTP API via cURL
# Use this script to test that your Telegram bot works.
#
# Install the dependency
#
# $ gem install telegram_bot
#
# Run the bot
#
# $ ruby bot.rb
#
@DaveThw
DaveThw / mosquitto
Last active December 24, 2017 15:59
init.d script for mosquitto (on a Raspberry Pi)
#!/bin/bash
### BEGIN INIT INFO
# Provides: mosquitto
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start or stop the mosquitto service
### END INIT INFO
@mariusavram91
mariusavram91 / compare_phpini_files.php
Created January 26, 2016 16:36
Compare two php.ini files
<?php
function conf_to_array($ini_file) {
$phpini = file($ini_file);
$configuration = array();
foreach($phpini as $line) {
if($line[0] == ";") { continue; }
if($line[0] == "[") { continue; }
if(trim($line) == "") { continue; }
$php_var = explode("=", $line);
@mapero
mapero / README.md
Last active October 15, 2021 18:30
mqtt job for dashing.io with publish and subscribe support

#Description This files will enable you to directly connect your widgets with your mqtt broker. It consists of a job, which will manage the connection to your project. It will over a rest api to publish, subscribe and unsubscribe from your widgets.

#Installation Add the mqtt.rb to your dashing jobs.

#Usage To connect a widget to mqtt use a post on 'mqtt/subscribe' on your constructor. As parameters you need to post the topic to subscribe and the widget id. E.g.:

 $.post 'mqtt/subscribe',
@jmb
jmb / README.md
Last active January 27, 2019 22:25
MQTT Data Subscriber for Dashing

Description

Dashing job to subscribe to MQTT messages.

MQTT is a lightweight publish/subscribe messaging transport. This job allows Dashing to subscribe to these messages and send them as events. There is no associated widget as the data can take any form - commonly numbers, but not necessarily. The script as laid out below sends events with value, current (the same contents) and last values so can be plugged directly into the Numbers or Meter widgets using the data-id in the dashboard file. The send_event could easily be modified if required.

Set up

Add to Gemfile:

@noelrocha
noelrocha / open_app.html
Created March 16, 2015 18:28
Open app on Google Play or AppStore
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Open App</title>
<!--
URL Params:
customSchemeURL: Your custom scheme app
@mic159
mic159 / README.md
Last active February 28, 2018 10:42
Dashing Widget: Red Green Meter

Dashing Widget: Red Green Meter

A modified Meter widget that sets the background colour to either red or green depending on a threshold.

To use it, use something like this on your dashboard:

    <li data-row="1" data-col="3" data-sizex="1" data-sizey="1">
 
@darekkay
darekkay / trakt-backup.php
Last active June 18, 2024 14:28
Trakt.tv backup script
<?php
/*
Backup script for trakt.tv (API v2).
Live demo: https://darekkay.com/blog/trakt-tv-backup/
*/
// create a Trakt app to get a client API key: http://docs.trakt.apiary.io/#introduction/create-an-app
$apikey = "CLIENT_API_KEY";
@irazasyed
irazasyed / spintax.php
Last active May 21, 2024 08:42
PHP: Text Spinner Class - Nested spinning supported.
<?PHP
/**
* Spintax - A helper class to process Spintax strings.
*/
class Spintax
{
/**
* Set seed to make the spinner predictable.
*/