Skip to content

Instantly share code, notes, and snippets.

View discarn8's full-sized avatar

discarn8 discarn8

View GitHub Profile
#!/bin/bash
# Descriprion:
# This simple script creates a local sd image backup of a remote raspberry pi in a local folder
# using ssh, dd, and the unix pipe
# Author: Fabio Nisci
# Date: 23/Apr/2014
# Requirements:
# - ssh
# - sshpass (auto installation)
@kirkbackus
kirkbackus / README.md
Last active October 1, 2019 22:31
MySQL Query For HeatMap

MySQL query that creates the data for a heatmap that takes in timezone. This will form the data necessary to produce a map like the Trulia Trends graph.

Initially I wrote a query that did not account for timezones

SELECT WEEKDAY(date_created)+1 as weekday, HOUR(date_created)+1 as hour, SUM(sub_total) as value FROM transaction WHERE voided = 0 GROUP BY weekday, hour;

This works great, if all of our customers lived in the Greenwhich Royal Observatory and shared that timezone. But as soon as we move outside that timezone, things get more complicated.

The second solution I came up with was to set an offset. And it looked like the following

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@charset "UTF-8";
article, aside, footer, header, main, nav, section {
display: block;
}
html, body, h1, h2, h3, ul, li, a, p,
article, aside, footer, header, main, nav, section {
padding: 0;
margin: 0;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>PeakMap</title>
<link rel="stylesheet" type="text/css" href="css/styles.css">
</head>
<body>
// this is how to write code in IFFE format and wait for the DOM to load to call certain functions
(function() {
'use strict';
function function1() {
}
Uncompahgre Peak
https://drive.google.com/uc?export=download&id=0B-c3hxDxskPGWHhPbVB4YmR5MDA
Mt. Elbert
https://drive.google.com/uc?export=download&id=0B-c3hxDxskPGU0Q0eWEwZmJzNnc
Pikes Peak
https://drive.google.com/uc?export=download&id=0B-c3hxDxskPGTmRPOEN1SVAxbDg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
section {
padding: 1em;
}
.color-1 {
color: red;
}
.color-2 {
color: blue;
@import 'colors';
@import 'mixins';
section {
padding: 1em;
}
.color-1 {
color: $color1;
}