Skip to content

Instantly share code, notes, and snippets.

View haty1's full-sized avatar

Simon haty1

  • Telstra
  • Melbourne, Australia
View GitHub Profile
@haty1
haty1 / robocopy_script.bat
Last active October 31, 2019 00:40
Uses robocopy to copy files and creates a log
echo off
Set Name=JobName
Set Source="\\servername\directory"
Set Target="C:\Destination"
Set FilePattern="filename*.xlsx"
Set Today=%date:~-4,4%%date:~-10,2%%date:~-7,2%_%time:~0,2%%time:~3,2%
Set Logname="C:\Logs\%Today%_%Name%.log"
Echo Source is %source%
Echo Target is %target%
LOAD
'Walkbys' AS location_metric_name,
granularity,
location_id,
hour(interval_start) AS hour_of_day,
weekday(interval_start) AS day_of_week,
sum(location_walkbys) AS location_metric_value
Resident location_traffic_metrics
WHERE granularity = 'Hourly'
AND hour(interval_start) >= $(OpeningHour)
/*
General format:
curl -X POST --data-urlencode 'payload={"channel": "#sense-notification", "username": "webhookbot", "text": "This is posted to #sense-notification and comes from a bot named sensebot.", "icon_emoji": ":ghost:"}' https://hooks.slack.com/services/<....enter_your_key_here....>
Formatting: https://slack.zendesk.com/hc/en-us/articles/202288908-How-can-I-add-formatting-to-my-messages-
More formatting formatting: https://api.slack.com/docs/formatting
Slack API docs: https://api.slack.com/incoming-webhooks
Available emojis: http://www.emoji-cheat-sheet.com/
*/
@haty1
haty1 / sense_set_max_date
Created October 24, 2017 09:59 — forked from mountaindude/sense_set_max_date
QlikView / Qlik Sense set expression to find largest date
// Use in chart title/subtitle/footer for describing what data is shown in a chart, etc
='Chart contains data up until and including ' & Date(Max({1} Date), 'YYYY-MM-DD')
@haty1
haty1 / sense_set_sum_per_max_date
Created October 24, 2017 09:56 — forked from mountaindude/sense_set_sum_per_max_date
QlikView / Sense set expression to pick the data for the last available date
// Sum FieldName per the last available date we have data for, withinin the current selection
Sum( {$<DateNum={$(#=Max(DateNum))}>} FieldName)
=rangeavg(above(sum(sales),0,3)) //3 Period Rolling Average
@haty1
haty1 / 0_reuse_code.js
Created November 22, 2015 10:58
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console