Skip to content

Instantly share code, notes, and snippets.

View charleskorn's full-sized avatar

Charles Korn charleskorn

View GitHub Profile
@charleskorn
charleskorn / sample.cpp
Created July 14, 2016 09:35
HTTP sample for Particle
String requestBody = constructRequestBody(time, values);
byte server[] = {10, 242, 127, 30};
TCPClient client;
if (client.connect(server, 8000))
{
Serial.println("Connected.");

Keybase proof

I hereby claim:

  • I am charleskorn on github.
  • I am charleskorn (https://keybase.io/charleskorn) on keybase.
  • I have a public key ASAfndyLfZAm1N2jWK0HC9P1e190CH681E0akTU8HRyo5Qo

To claim this, I am signing this object:

@charleskorn
charleskorn / getExceptionFromLog.sh
Last active March 11, 2020 10:56
Get exception details from batect log file
cat ~/Desktop/log.json | jq -r 'select(.exception != null) | .exception'
@charleskorn
charleskorn / terraform-debug.log
Last active April 12, 2020 09:51
google_cloud_run_service doesn't show details when definition is invalid (https://github.com/terraform-providers/terraform-provider-google/issues/6099)
2020-04-12T09:43:21.872Z [DEBUG] plugin.terraform-provider-google_v3.15.0_x5: -----------------------------------------------------
2020-04-12T09:43:24.134Z [DEBUG] plugin.terraform-provider-google_v3.15.0_x5: 2020/04/12 09:43:24 [DEBUG] Google API Response Details:
2020-04-12T09:43:24.134Z [DEBUG] plugin.terraform-provider-google_v3.15.0_x5: ---[ RESPONSE ]--------------------------------------
2020-04-12T09:43:24.134Z [DEBUG] plugin.terraform-provider-google_v3.15.0_x5: HTTP/1.1 400 Bad Request
2020-04-12T09:43:24.134Z [DEBUG] plugin.terraform-provider-google_v3.15.0_x5: Connection: close
2020-04-12T09:43:24.134Z [DEBUG] plugin.terraform-provider-google_v3.15.0_x5: Transfer-Encoding: chunked
2020-04-12T09:43:24.134Z [DEBUG] plugin.terraform-provider-google_v3.15.0_x5: Alt-Svc: <REDACTED>
2020-04-12T09:43:24.135Z [DEBUG] plugin.terraform-provider-google_v3.15.0_x5: Cache-Control: private
2020-04-12T09:43:24.135Z [DEBUG] plugin.terraform-provider-google_v3.15.0_x5: Content-Type: application/json; charset=UTF-
@charleskorn
charleskorn / superagent.js
Last active September 6, 2021 06:40 — forked from pherris/superagent.js
A Jest mock for superagent. Place in your __mocks__ directory.
'use strict';
var mockDelay;
var mockError;
var mockResponse = {
status: function () {
return 200;
},
ok: true,
get: jest.genMockFunction(),