Skip to content

Instantly share code, notes, and snippets.

View theinventor's full-sized avatar

Troy Anderson theinventor

View GitHub Profile
@theinventor
theinventor / html-follow-up-with-thumbs.html
Last active November 9, 2017 15:11
Marketr Template for follow up with thumbs up and down
<p>&nbsp;</p>
<p><span style="font-size: 20px;">Hey {{customer_first_name}}!</span></p>
<p>&nbsp;</p>
<p><span style="font-size: 20px;">It's been&nbsp;a few days since you picked up your device. We would love to know how the repair went and how it has settled since then.&nbsp;</span></p>
<table style="height: 370px;" width="495">
<tbody>
<tr>
<td><a title="Thumbs Up!" href="YOURWEBSITE/reviews"><img src="https://i.imgur.com/tMoWjMp.png" alt="Thumb Up" width="280" height="280" /></a></td>
<td><a title="Thumbs Down!" href="https://goo.gl/forms/YOURGOOGLEFORMHERE"><img src="https://i.imgur.com/Y8udxX8.png" alt="Thumb Down" width="280" height="280" /></a></td>
</tr>
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"status":"Resolved"}' https://subdomain.repairshopr.com/api/v1/tickets/TICKET_ID_OR_NUMBER?api_key=YOUR_API_KEY
@theinventor
theinventor / google_calendar_repairshopr_alarm.rb
Last active September 27, 2017 18:49
Simple script to hit RepairShopr API and make an alarm clock - runs on raspberry pi
require 'json'
require 'time'
require "net/https"
require "uri"
# put this file in same folder; https://www.dropbox.com/s/etugzo0utqbr5gv/seatbelt.mp4?dl=0
line1 = "#{Time.now.strftime("%b %e ")}"
line2 = "#{Time.now.strftime("%l : %M %P")}"
puts `figlet #{line1}`
puts `figlet #{line2}`
zlawey0 eseldner1 wcasaccio2 eajam3 nnellies4 spidgen5 mknagges6 stortice7 rmoscrop8 cravenhill9 tgainseforda fvannuccinib abrookesbiec hflintuffd winggalle lizakofff bhyndeg freadwinh rpirrii fkopjej dparncuttk oboutellierl gfrederickm dletfordn dgratlando eelderfieldp vregelousq cportwainer alossmans drhoadest jtymu rellcockv hbrettonw vpaddefieldx nregoy fdyetz ikarlicek10 jkilvington11 dspellsworth12 msprott13 sollier14 kverrillo15 ccregeen16 treinbach17 abreitling18 gledington19 cchatell1a aelliff1b menston1c cmatis1d egrimwad1e mliley1f glaurent1g ejoffe1h pkittiman1i egilhooley1j covershott1k labilowitz1l ssimmell1m blafrentz1n zbawcock1o kdaughtry1p lscrange1q anovacek1r sdyett1s agamblin1t cjozwik1u rhellwig1v rstutter1w czotto1x dwheelband1y dfrediani1z cjoerning20 aduddell21 bminer22 phackworth23 dhazel24 lhorsell25 tblais26 rconner27 kbeadman28 acorradino29 tbarling2a pvyse2b ccollingridge2c bpo2d amille2e ddudek2f egaskell2g fnarramor2h jgawthorp2i cbiffen2j wcrossfeld2k epeyton2l cblakely2m rrol
# -*- coding: utf-8 -*-
class LittleSchoolPhotoDownloader
def connect
@user = OpenStruct.new(email: ENV['USER'],password: ENV['PASSWORD'])
@login_url = "https://www.thelittleschool.org/user/login?destination=my-portal"
@base_url = ENV['CLASSROOM_URL']
@agent = Mechanize.new
page = @agent.get(@login_url)
@theinventor
theinventor / php_products_get.php
Created June 2, 2017 18:30
Simple example of getting products via RepairShopr API in PHP
$subdomain = "demo";
$apiKey = "abc123";
$json = file_get_contents("https://{$subdomain}.repairshopr.com/api/v1/products?api_key={$apiKey}");
$data = json_decode($json);
echo $data->{'products'};
{"account_subdomain":"repairshopr","created_at":"2016-09-08 08:42:42 -0700","delivery_tracking":"","due_date":null,"expected_date":null,"id":"78298","line_items":[{"cost":"35.0","created_at":"2016-09-08 08:42:54 -0700","id":"415104","product_id":"2722794","purchase_order_id":"78298","quantity":"10","sku":"","total":"350.0","updated_at":"2016-09-08 08:42:54 -0700"},{"cost":"0.0","created_at":"2016-09-08 13:42:44 -0700","id":"415653","product_id":"68376","purchase_order_id":"78298","quantity":"6","sku":"","total":"0.0","updated_at":"2016-09-08 13:42:44 -0700"},{"cost":"91.3","created_at":"2016-09-08 13:42:44 -0700","id":"415652","product_id":"42657","purchase_order_id":"78298","quantity":"4","sku":"","total":"365.2","updated_at":"2016-09-08 13:42:44 -0700"},{"cost":"5.0","created_at":"2016-09-08 13:42:44 -0700","id":"415651","product_id":"42","purchase_order_id":"78298","quantity":"10","sku":"","total":"50.0","updated_at":"2016-09-08 13:42:44 -0700"}],"location":null,"location_id":null,"number":"D-20160908-1","
Highcharts.chart('.RedYellowChart', {
chart: {
plotBackgroundColor: null,
plotBorderWidth: 0,
plotShadow: false
},
title: {
text: 'Browser<br>shares<br>2015',
align: 'center',
verticalAlign: 'middle',
<?xml version="1.0" encoding="UTF-8"?>
<order>
<number>123ABC</number>
<shipping-method>UPS Ground</shipping-method>
<shipping-price type="float">34.15</shipping-price>
<status>Processed</status>
<entries type="array">
<entry>
<123123>
<quantity-requested type="integer">5</quantity-requested>
{
"number": "123ABC",
"shipping_method": "UPS Ground",
"shipping_price": 34.15,
"status": "Processed",
"entries": [
{
"123123": {
"quantity_requested": 5,
"quantity_backordered": 0,