Skip to content

Instantly share code, notes, and snippets.

View jackphilippi's full-sized avatar
🌱

Jack Philippi jackphilippi

🌱
View GitHub Profile
import requests
response = requests.get('https://api.example.com/data')
data = response.json()
data <- read.csv("~/Desktop/ref.csv")
result <- list()
if (nrow(data) %% 2 == 1) {
stop("CSV file must have an even number of rows.")
}
for (i in seq(1, nrow(data), by=2)) {
row1 <- data[i,]
row2 <- data[i+1,]
@jackphilippi
jackphilippi / cloudSettings
Last active April 12, 2021 04:32
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-06-18T07:07:11.773Z","extensionVersion":"v3.4.3"}

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

const defaultAvailableCounters = [
'flying',
'first strike',
'deathtouch',
'hexproof',
'lifelink',
'menace',
'reach',
'trample',
'vigilance',
#include "SPI.h"
int DATA = 11;
int CLOCK = 13;
int LATCH = 5;
void setup() {
Serial.begin(115200);
SPI.begin();
}
@jackphilippi
jackphilippi / pre-request-jwt.js
Last active January 7, 2019 02:35 — forked from corbanb/pre-request-jwt.js
JWT tokenize - Postman Pre-Request Script
var header = {
alg: "HS256",
typ: "JWT"
};
var data = injectIAT({
userId: "<userID>",
username: "<user>",
email: "<email>",
displayName: "<displayName>",
using System.Net.Http;
// Create a new HTTP client which we will use to send the request
private static readonly HttpClient client = new HttpClient();
// Create a dictionary with the value(s) you want to send
var values = new Dictionary<string, string>
{
{ "firstNumber", 123 },
{ "secondNumber", 456 },
@jackphilippi
jackphilippi / messageCache.js
Last active August 13, 2021 02:39
Message cache for handling queues with sqs
const logger = require('../../logger');
/**
* A cache for handling the delay of SQS messages
* @param {Object} opts The options object
*/
function MessageCache(opts) {
// Store the messages that we receive, so that we can
// keep track of the visibility timeout for these messages
this.messageCache = {};
let byte = 0;
let shift = 0;
[0, 1, 1, 1, 1, 0, 0, 1]
.map((bit) => {
byte = byte | bit << (7 - shift);
});
console.log(`The input byte evaluates to ${byte}`);