Skip to content

Instantly share code, notes, and snippets.

View jklemmack's full-sized avatar

Johann Klemmack jklemmack

View GitHub Profile
@ysdede
ysdede / influxdb2.sh
Last active November 25, 2023 19:32
InfluxDB 2.x Open Source Time Series Database on wsl2
wget -qO- https://repos.influxdata.com/influxdb.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdb.gpg > /dev/null
export DISTRIB_ID=$(lsb_release -si); export DISTRIB_CODENAME=$(lsb_release -sc)
echo "deb [signed-by=/etc/apt/trusted.gpg.d/influxdb.gpg] https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list > /dev/null
sudo apt-get update && sudo apt-get install influxdb2
sudo chmod +x /etc/init.d/influxdb
sudo chown root:root /etc/init.d/influxdb
sudo update-rc.d influxdb defaults
sudo update-rc.d influxdb enable
@mando7
mando7 / gpu-list.md
Last active October 27, 2022 00:00
Nvidia graphics card sorted by Cuda cores.
@louis-e
louis-e / UDPSocket.cs
Last active April 14, 2024 02:43 — forked from darkguy2008/UDPSocket.cs
Simple C# UDP server/client in 62 lines
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace UDP
{
public class UDPSocket
{
public Socket _socket;
@bobend
bobend / ffmpeg-process-pining-MedallionShell.linq
Created December 3, 2018 15:18
c# ffmpeg stream piping example
<Query Kind="Program">
<NuGetReference>MedallionShell</NuGetReference>
<Namespace>System.Threading.Tasks</Namespace>
<Namespace>Medallion.Shell</Namespace>
<Namespace>Medallion.Shell.Streams</Namespace>
</Query>
DumpContainer dc;
async Task Main()
{ var input = @"D:\Temp\fieldtest.mxf".Dump("input file");
@robmathers
robmathers / groupBy.js
Created October 25, 2018 23:18
A more readable and annotated version of the Javascript groupBy from Ceasar Bautista (https://stackoverflow.com/a/34890276/1376063)
var groupBy = function(data, key) { // `data` is an array of objects, `key` is the key (or property accessor) to group by
// reduce runs this anonymous function on each element of `data` (the `item` parameter,
// returning the `storage` parameter at the end
return data.reduce(function(storage, item) {
// get the first instance of the key by which we're grouping
var group = item[key];
// set `storage` for this instance of group to the outer scope (if not empty) or initialize it
storage[group] = storage[group] || [];
@cakriwut
cakriwut / ServiceBaseExtensions.cs
Created December 29, 2015 14:58
ServiceStack Extensions to POST multiple files along with dto.
///<summary>
/// ServiceClient Base Extensions
/// Author: Riwut Libinuko
/// Created Date: 29/12/2015
/// Website : http://blog.libinuko.com
/// Copyright(c) 2015
/// Use PostFilesWithRequest<TResponse>(...) , to POST metadata and multiple files attachment in single request
///</summary>
public static class ServiceClientBaseExtensions
{
@weipah
weipah / import-portatour.ps1
Last active March 4, 2024 22:34
PowerShell V3 Multipart/formdata example with REST-API (Invoke-RestMethod)
function Import-Portatour {
param (
[parameter(Mandatory=$True,Position=1)] [ValidateScript({ Test-Path -PathType Leaf $_ })] [String] $FilePath,
[parameter(Mandatory=$False,Position=2)] [System.URI] $ResultURL
)
# CONST
$CODEPAGE = "iso-8859-1" # alternatives are ASCII, UTF-8
# We have a REST-Endpoint
$RESTURL = "https://my.portatour.net/a/api/ImportCustomers/"
<#
.SYNOPSIS
Resize an image
.DESCRIPTION
Resize an image based on a new given height or width or a single dimension and a maintain ratio flag.
The execution of this CmdLet creates a new file named "OriginalName_resized" and maintains the original
file extension
.PARAMETER Width
The new width of the image. Can be given alone with the MaintainRatio flag
.PARAMETER Height
@belsrc
belsrc / gist:672b75d1f89a9a5c192c
Last active April 15, 2023 15:13
Simple Vue.js filters that I usually need
/**
* Changes value to past tense.
* Simple filter does not support irregular verbs such as eat-ate, fly-flew, etc.
* http://jsfiddle.net/bryan_k/0xczme2r/
*
* @param {String} value The value string.
*/
Vue.filter('past-tense', function(value) {
// Slightly follows http://www.oxforddictionaries.com/us/words/verb-tenses-adding-ed-and-ing
var vowels = ['a', 'e', 'i', 'o', 'u'];
@scottmcarthur
scottmcarthur / ServiceStackIsolatedAppHostTest.cs
Created September 25, 2014 15:34
ServiceStack AppHost Running in it's own AppDomain for Tests
using System;
using ServiceStack;
using System.Runtime.Remoting;
using NUnit.Framework;
namespace MyApp.Tests
{
public class AppHost : AppSelfHostBase
{
public AppHost(): base("My ServiceStack Service", typeof(AppHost).Assembly)