Skip to content

Instantly share code, notes, and snippets.

View Schm1tz1's full-sized avatar
🇺🇦
#StandWithUkraine

Roman Schmitz Schm1tz1

🇺🇦
#StandWithUkraine
View GitHub Profile
@andypiper
andypiper / readserial.py
Created September 15, 2011 09:56
Scrape serial port for text data and publish on MQTT
#!/usr/bin/python
#
#simple app to read string from serial port
#and publish via MQTT
#
#uses the Python MQTT client from the Mosquitto project
#http://mosquitto.org
#
#Andy Piper http://andypiper.co.uk
#2011/09/15
/* usbreset -- send a USB port reset to a USB device
*
* Compile using: gcc -o usbreset usbreset.c
*
*
* */
@tfeldmann
tfeldmann / i2c_scanner.ino
Created April 18, 2013 09:13
A I2C Scanner for Arduino
// --------------------------------------
// i2c_scanner
//
// Version 1
// This program (or code that looks like it)
// can be found in many places.
// For example on the Arduino.cc forum.
// The original author is not known.
// Version 2, Juni 2012, Using Arduino 1.0.1
// Adapted to be as simple as possible by Arduino.cc user Krodal
@lordofthelake
lordofthelake / .gitignore
Created June 21, 2013 18:39
.gitignore for Maven, Intellij, Eclipse
# Eclipse
.classpath
.project
.settings/
# Intellij
.idea/
*.iml
*.iws
@asafary
asafary / Person.java
Last active April 30, 2024 11:36
Example of how to read a Pojo from a CSV file using Jackson JSON Processor
package org.asafary.csv;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonPropertyOrder({ "name", "surname", "shoesize", "gender" })
public class Person {
public String name;
public String surname;
public int shoesize;
@l0ki000
l0ki000 / csd-wrapper.sh
Last active March 7, 2025 10:14 — forked from zer4tul/gist:6477470
Cisco Anyconnect CSD wrapper for OpenConnect (exhanced to autodownload and autoupdate hostscan)
#!/bin/bash
# Cisco Anyconnect CSD wrapper for OpenConnect
# Enter your vpn host here
CSD_HOSTNAME=
if [[ -z ${CSD_HOSTNAME} ]]
then
echo "Define CSD_HOSTNAME with vpn-host in script text. Exiting."
exit 1
fi
@ghinda
ghinda / object-to-form-data.js
Last active September 17, 2024 05:22
JavaScript Object to FormData, with support for nested objects, arrays and File objects. Includes Angular.js usage.
// takes a {} object and returns a FormData object
var objectToFormData = function(obj, form, namespace) {
var fd = form || new FormData();
var formKey;
for(var property in obj) {
if(obj.hasOwnProperty(property)) {
if(namespace) {
@githubutilities
githubutilities / Uninstall-pkg.md
Last active March 13, 2025 14:47
Uninstall pkg manually in OS X

Mac Uninstall pkg Manually

  • using pkgutil
# list all your installed packages
pkgutil --pkgs

# show your package info
pkgutil --pkg-info 
@GopinathMR
GopinathMR / NonLazySingleton.java
Last active April 20, 2021 08:45
how to mock methods in Singleton
// sample code written to showcase how to use Mockito to mock certain methods to test logic in Singleton classes
public class MySingletonClass {
// not lazy initiated object.
private static final MySingeltonClass INSTANCE = new MySingletonClass();
// can be used by unit test by Mocking it. Mockito invokes this default constructor.
@VisibleForTesting
MySingletonClass {
@windytan
windytan / whistle-encode.pl
Last active March 22, 2025 00:30
whistle encoder
#!/usr/bin/perl
# windytan's pea whistle encoder
# http://www.windytan.com/2015/10/pea-whistle-steganography.html
# (c) 2015 Oona Räisänen
# ISC license
use warnings;
use strict;
my $data = $ARGV[0] // "OHAI!";