Skip to content

Instantly share code, notes, and snippets.

View emrysr's full-sized avatar

Emrys Roberts emrysr

View GitHub Profile
@emrysr
emrysr / dabblet.css
Created February 23, 2012 15:49
Fallback options
body{
margin:3em;
background:#59B4C7;
background-image: radial-gradient(rgba(255,255,255,.7) 15%, transparent 16%), radial-gradient(rgba(255,255,255,.7) 15%, transparent 16%);
background-size:30px 30px;
background-position: 0 0, 15px 15px;
}
body *{
font-family: "Century Gothic", /* Windows (HP printer) */
@emrysr
emrysr / designer.html
Created August 27, 2014 13:29
designer
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
<link rel="import" href="../topeka-elements/topeka-datasource.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
@emrysr
emrysr / designer.html
Created August 27, 2014 13:42
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
@emrysr
emrysr / migrate-website
Last active April 12, 2017 09:05
use this to download a database and files to local version. keeping db backup - you need mysql and ssh installed on both machines
#!/bin/bash
#
#=============================================
## SYNC DESTINATION WITH SRC FILES & DB
## uses rsync and mysqldump to copy files to
## destination system from source system
#=============================================
# emrys@matrix10.net 2017-04-07
# ---REQUIRED --------------------------------
# commands used: ssh,pv,mysqldump,printf,zcat and rsync
@emrysr
emrysr / bootstrap4 price comparison
Created March 21, 2018 13:01
zoom the middle card element to suggest that it is more important. bootstrap 4
<div class="bg-light">
<div class="container">
<div class="row flex-items-xs-middle flex-items-xs-center">
<div class="col mb-5">
<div class="card text-xs-center bg-info text-light">
<div class="card-header">
<h4><span class="currency">&pound;</span>00<span class="period">/year</span></h4>
</div>
<div class="card-body">
<h5 class="card-title mb-0">Group Membership</h5>
@emrysr
emrysr / mqtt-pub-test.php
Created July 2, 2018 22:49
Mosquitto-PHP test script for emoncms
<?php
/*
creates mosquitto client and connects before the infinite blocking loop loopForever()
is used to keep the connection until finished
it finishes when the disconnect() is called once the publish() is sent
I have been able to loop this in a bash script 50 times without error:
`
$ for i in {1..50}; do php mqtt-pub-test.php ; done
@emrysr
emrysr / mqtt_publish.php
Created July 3, 2018 13:09
test emonpi mqtt publish
<?php
namespace mqttPub;
define('EMONCMS_EXEC', 1);
/*
All Emoncms code is released under the GNU Affero General Public License.
See COPYRIGHT.txt and LICENSE.txt.
---------------------------------------------------------------------
Emoncms - open source energy visualisation
@emrysr
emrysr / emoncms-docker-mysql-connect
Last active July 19, 2018 12:38
connect to emoncms mysql container started with docker-compose
docker run -it --link emoncmsdocker_db_1:mysql --net emoncmsdocker_default --rm mysql sh -c 'exec mysql -hdb -uemoncms -pYOUR_SECURE_PASSWORD emoncms'
@emrysr
emrysr / work-done.bash
Created July 24, 2018 13:50
get all commits on all branches for an author
git log --pretty=format:"%ad:%an:%d:%B" --date=short --reverse --branches --since=2.months.ago --author=Emrys