Skip to content

Instantly share code, notes, and snippets.

View netskink's full-sized avatar

John F. Davis netskink

View GitHub Profile
@netskink
netskink / Convert .mov or .MP4 to .gif.md
Created May 9, 2025 18:09 — forked from SheldonWangRJT/Convert .mov or .MP4 to .gif.md
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@netskink
netskink / six_moves_issue.md
Last active August 5, 2024 17:11
six moves issue draft

Using python 3.12.1 on z/OS UNIX. Using a venv to install various libs. Google chromium depot tools uses python and six to get code from a git repo.

TODO: This was originally written for the six github issues tracker.

Setup

  • python 3.12.1
@netskink
netskink / fileio.swift
Last active February 24, 2023 16:19
try catch in swift and variable visibility
func mySimpleFileRead(path: String) throws -> UnitsData {
let fileName = (path as NSString).expandingTildeInPath
let url = URL(fileURLWithPath: fileName)
let data = try Data(contentsOf: url)
return try JSONDecoder().decode(UnitsData.self, from: data)
}
@netskink
netskink / mkrnb1500.ino
Created September 7, 2021 16:52
mkrnb1500.ino get serial buffer to empty?
/*
This code clears the u-blox on a MKR NB 1500 of all certificates.
*/
// baud rate used for both Serial ports
unsigned long baud = 115200;
// Must be large enough to capture all
@netskink
netskink / up_mon0.sh
Last active July 25, 2021 03:28
script for wireshark setup
# have the channels to be the same.
DEFAULT_CHANNEL=11
echo "Setting up wifi monitor interface on" $WIPHY
#ORIG sudo iw phy $WIPHY interface add mon0 type monitor flags none control otherbss
sudo iw $WIPHY interface add mon0 type monitor flags none control otherbss
echo "Bringing up $MONIF"
#ORIG sudo ifconfig mon0 up promisc
# I did this by accident. In case it mattered. I already had the network in use so no telling.
@netskink
netskink / afilename
Last active July 23, 2021 20:37
Trying to debug why I can not get the arduino connected to Google Cloud Platform IoT Core via MQTT
# Background
So, filed an issue with the arduino gcp library I am using. Its (here)[https://github.com/GoogleCloudPlatform/google-cloud-iot-arduino/issues/230]
# Pivot
I was looking through code and getting lost, so I thought it might be helpful to see what happens in wireshark.
I figure I don't know SSL/TLS so at least just running a tool might enlighten me about the subject as well as perhaps
see where the failure occurs. For instance in GCP I dont see any errors in logs, so I am very concerned that it might be
failing after getting time sync from ntp server prior to first reporting of telemetry via mqtt. (From my limited time with
the code tracing it fails on the first read with a read failure error).
@netskink
netskink / gist:f54cc0767e788058385ea3f3b7ba0c77
Created July 23, 2021 15:00
wifi101 ip and mac address dump
void setupWifi() {
Serial.println("Starting wifi");
WiFi.begin(ssid, password);
Serial.println("Connecting to WiFi");
while (WiFi.status() != WL_CONNECTED) {
delay(100);
}
Serial.println("Waiting on time sync...");
sobel_vertical = nd.array((
(1,0,-1),
(2,0,-2),
(1,0,-1)
))
print("\nSobel vertical transform Gx", end='')
print(sobel_vertical)
rotation_90_x = nd.array((
( 1, 0, 0),
@netskink
netskink / testy.py
Last active June 5, 2020 03:00
switch implemented with a dictionary
def one():
return "this is function one"
def two():
return "this is function two"
def three():
return "this is function three"
@netskink
netskink / ns_Heap.py
Created May 2, 2020 00:19
binary heap class
a min heap implementation for use with micropython
class ns_Heap(object):
""""
Attributes:
heap: List representation of a min heap