Skip to content

Instantly share code, notes, and snippets.

View Benargee's full-sized avatar

Benargee Benargee

  • Ontario, Canada
View GitHub Profile
@Benargee
Benargee / 1.README.md
Created April 10, 2023 03:00 — forked from varemenos/1.README.md
Git log in JSON format

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit
@Benargee
Benargee / ArduinoMEGA_CounterT5.cpp
Created January 31, 2023 03:16
Simple code to setup, increment and print Timer/Counter5 on pin47/PL2/T5
// Arduino Mega (2560) Platform.io
//Simple code to setup, increment and print Timer/Counter5 on pin47/PL2/T5
#include <Arduino.h>
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
TCCR5A=0; //Timer/Counter 5 Control Register A
TCCR5B=0; //Timer/Counter 5 Control Register B
systemChat "Dump start";
_weaponCfgs = configfile >> "CfgWeapons";
_cfgCount = count _weaponCfgs;
_primaryStr = "";
_secondaryStr = "";
_launcherStr = "";
_exportStr = "";
@Benargee
Benargee / Example.md
Last active April 13, 2020 02:38
Draw lineIntersectsSurfaces point Arma 3

alt text

@Benargee
Benargee / rainbowLog.js
Last active January 1, 2022 17:24
A console.log with a little more... flair.
console.rainbow = function (str) {
const colors = [
"red",
"orange",
"yellow",
"green",
"blue",
"indigo",
"violet",//white in VS Code
@Benargee
Benargee / simple_websocket.html
Created October 30, 2017 00:54 — forked from SadatAnwar/simple_websocket.html
A working implementation of the super simple websocket python server
<!DOCTYPE html>
<html lang="en">
<head>
<title>WebSocket Client</title>
<style>
#output {
border: solid 1px #000;
}
</style>
</head>
@Benargee
Benargee / simple_websocket_client.html
Created October 30, 2017 00:47 — forked from geoffb/simple_websocket_client.html
Super simple websockets client/server using Python. Compatible with the draft 76 challenge/response.
<!DOCTYPE html>
<html lang="en">
<head>
<title>WebSocket Client</title>
<style>
#output {
border: solid 1px #000;
}
</style>
</head>
@Benargee
Benargee / Py3-dummy-web-server.py
Last active October 29, 2017 03:57 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python 3. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@Benargee
Benargee / Breath.ino
Last active August 21, 2017 01:00
Controller for 24v LED lightbar driven by IRFZ44 MOSFET
/*
Breathing Led bar
By: Benargee
*/
int ledPin = 9; // LED connected to digital pin 9
int count = 2;
int inerval = 1; //interval in miliseconds between loops
int order = 1; //indicates order of decreasing or increasing intensity. 1: increasing -1:decreasing
const int minVal = 1;
@Benargee
Benargee / cpuRamUsage.cs
Last active August 20, 2017 22:39
Arduino CPU and RAM usage monitor. Credit goes to this post: https://www.reddit.com/r/arduino/comments/6uwkv5/cpu_and_ram_usage_monitor/
//CPU&RAM counter by Sharpy
using System;
using System.Windows.Forms;
using System.IO.Ports;
using System.Diagnostics;
namespace WindowsFormsApplication14
{
public partial class Form1 : Form