Skip to content

Instantly share code, notes, and snippets.

View schappim's full-sized avatar
💤
Sleeping . +10GMT

Marcus S schappim

💤
Sleeping . +10GMT
View GitHub Profile
#!/usr/bin/python
# Written by pcmanbob
# https://www.raspberrypi.org/forums/memberlist.php?mode=viewprofile&u=71930&sid=78c72fd5d7f7c6d39cf3b3ddcc9a0ed5
# See: https://www.raspberrypi.org/forums/viewtopic.php?t=228207#p1399745
# Import required Python libraries
import time
import RPi.GPIO as GPIO
{
"errors": [
{
"message": "The request failed authentication",
"error_code": "API_001",
"error_name": "Unauthenticated request"
}
]
}
{% assign local_inv = product.variants.first.inventory_quantity %}
{% assign supplier_inv = product.metafields.inventory['supplier_inventory'] %}
{% if local_inv < 0 %}
{% assign local_inv = 0 %}
{% endif %}
{% if supplier_inv < 0 %}
{% assign supplier_inv = 0 %}
{"labels"=>[{"request_id"=>"3255d1dd-f116-4f3e-8dc3-9a2fe5394ce8", "status"=>"PENDING", "request_date"=>"11-02-2019 13:17:22", "shipments"=>[{"shipment_id"=>"pWgK0EyLfLsAAAFozjkjhNpY", "options"=>{}}], "shipment_ids"=>["pWgK0EyLfLsAAAFozjkjhNpY"]}]}
"PENDING"
^C^C{"labels"=>[{"request_id"=>"3255d1dd-f116-4f3e-8dc3-9a2fe5394ce8", "status"=>"PENDING", "request_date"=>"11-02-2019 13:17:22", "shipments"=>[{"shipment_id"=>"pWgK0EyLfLsAAAFozjkjhNpY", "options"=>{}}], "shipment_ids"=>["pWgK0EyLfLsAAAFozjkjhNpY"]}]}
"PENDING"
{"labels"=>[{"request_id"=>"3255d1dd-f116-4f3e-8dc3-9a2fe5394ce8", "status"=>"PENDING", "request_date"=>"11-02-2019 13:17:22", "shipments"=>[{"shipment_id"=>"pWgK0EyLfLsAAAFozjkjhNpY", "options"=>{}}], "shipment_ids"=>["pWgK0EyLfLsAAAFozjkjhNpY"]}]}
"PENDING"
{"labels"=>[{"request_id"=>"3255d1dd-f116-4f3e-8dc3-9a2fe5394ce8", "status"=>"PENDING", "request_date"=>"11-02-2019 13:17:22", "shipments"=>[{"shipment_id"=>"pWgK0EyLfLsAAAFozjkjhNpY", "options"=>{}}], "shipment_ids"=>["pWgK0EyLfLsAAAFozjkj
/*
A quick test script or the customer:
OUT --> A0
VCC --> 5V
GND --> GND
*/
#!/usr/bin/env ruby
require 'sinatra'
post '/ws' do
request.body
end
@schappim
schappim / gist:5bd15ce5ccb69f1bbaa0bff4e1939804
Created December 12, 2018 23:17
full-uni-market-response.txt
"#<HTTParty::Response:0x7fb6a18e6958 parsed_response=\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<Fault>Internal Server Error</Fault>\\n\", @response=#<Net::HTTPBadRequest 400 Bad Request readbody=true>, @headers={\"date\"=>[\"Wed, 12 Dec 2018 23:16:52 GMT\"], \"server\"=>[\"Apache\"], \"cache-control\"=>[\"no-cache, no-store, max-age=0, must-revalidate\"], \"pragma\"=>[\"no-cache\"], \"expires\"=>[\"0\"], \"strict-transport-security\"=>[\"max-age=63072000; includeSubDomains\"], \"x-xss-protection\"=>[\"1; mode=block\"], \"x-content-type-options\"=>[\"nosniff\"], \"x-frame-options\"=>[\"SAMEORIGIN\"], \"content-security-policy\"=>[\"default-src 'self'; script-src https: 'self' https://ssl.google-analytics.com *.newrelic.com bam.nr-data.net 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src https: 'self' https://ssl.google-analytics.com bam.nr-data.net; frame-src 'self' https://xtracta.unimarket.com accounts.google.com; child-src 'self' https://xtracta.unimarket.com; frame-ance
import curses
stdscr = curses.initscr()
curses.cbreak()
stdscr.keypad(1)
stdscr.addstr(0,10,"Hit 'q' to quit")
stdscr.refresh()
key = ''
while key != ord('q'):
@schappim
schappim / buzzer-example.ino
Last active November 21, 2018 02:44
Buzzer Push Button Example
// constants won't change. They're used here to set pin numbers:
const int buttonPin = 2; // the number of the pushbutton pin
const int button1Pin = 3; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
const int buzzerPin = 9; // buzzer to arduino pin 9
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
int button1State = 0; // variable for reading the pushbutton status
@schappim
schappim / youtube-error.txt
Created October 17, 2018 02:03
YouTube Error Message
500 Internal Server Error
Sorry, something went wrong.
A team of highly trained monkeys has been dispatched to deal with this situation.
If you see them, send them this information as text (screenshots frighten them):
APkpgMUrHPpBCHeQdKd7flYnGPVTrexzZIgAIxhwq57DU2Tc1iVbLrJZ
vMldJIOVr6pNLb9Fk19AlgGFXAqA-v0wd3oKjrcKvsI07lT1IOwF-ACV
psMjYcu2wOiR61oBzB_d9j5LCK3zZ_RXvvKZYnVj17LvTs_RGa-AdNhE
JcvGolrPZHQbYS6YMJj3mqOGmtpwdHuJ4Alir2hh1evh7XmA5cActvHy