Skip to content

Instantly share code, notes, and snippets.

View freegroup's full-sized avatar

man from earth freegroup

  • -free-
View GitHub Profile
@freegroup
freegroup / commit.js
Created February 9, 2023 19:25 — forked from lilmuckers/commit.js
A node.js script that utilises the githubber node.js GitHub API integration module to commit changes to a repository
//set up the object with the api details
function GitHubCommit(api, owner, repo, ref)
{
this.api = api;
this.repo = {
owner: owner,
repo: repo,
ref: ref
}
}
@freegroup
freegroup / k8s-list-virtualservices.go
Created May 2, 2022 14:01 — forked from dwmkerr/k8s-list-virtualservices.go
Example showing how to list Istio VirtualService CRDs Golang
// Example showing how to patch Kubernetes resources.
package main
import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/dynamic"
_ "k8s.io/client-go/plugin/pkg/client/auth"
@freegroup
freegroup / github.js
Created April 14, 2022 12:06 — forked from StephanHoyer/github.js
Commiting multiple files to github over API
'use strict';
var Octokat = require('octokat');
var extend = require('lodash/object/assign');
var defaults = {
branchName: 'master',
token: '',
username: '',
reponame: ''
@freegroup
freegroup / birds-eye-view.cpp
Created September 21, 2021 08:48 — forked from anujonthemove/Birds-Eye-View Transformation.pdf
Bird's eye view perspective transformation using OpenCV
// OpenCV imports
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
// C++ imports
#include <iostream>
// namespaces
using namespace std;
using namespace cv;
@freegroup
freegroup / otsu.js
Created June 5, 2020 22:46 — forked from zz85/otsu.js
Otsu's method - Automatic Histogram Based Image Thresholding
// Read https://en.wikipedia.org/wiki/Otsu%27s_method (added this since JS examples in wikipedia didn't work)
function otsu(histData /* Array of 256 greyscale values */, total /* Total number of pixels */) {
let sum = 0;
for (let t=0 ; t<256 ; t++) sum += t * histData[t];
let sumB = 0;
let wB = 0;
let wF = 0;
@freegroup
freegroup / find_cam.py
Created October 4, 2019 21:38 — forked from kphretiq/find_cam.py
Identify Camera Device Linux
"""
#Installing v4l-utils (debian) gives one the handy v4l2-ctl command:
$ v4l2-ctl --list-devices
HPigh Definition Webcam (usb-0000:00:14.0-11):
/dev/video2
UVC Camera (046d:0821) (usb-0000:00:14.0-13):
/dev/video0