Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Jan Kuri jkuri

🏠
Working from home
Block or report user

Report or block jkuri

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jkuri
jkuri / sshd.go
Created Apr 14, 2018 — forked from jpillora/sshd.go
Go SSH server complete example - Read more here https://blog.gopheracademy.com/go-and-ssh/
View sshd.go
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
@jkuri
jkuri / README.md
Created Mar 25, 2018
Output all video devices, capabilities, frame sizes and related framerates on Linux using V4L2
View README.md

Output all video devices, capabilities, frame sizes and related framerates on Linux using V4L2

Compile it using

clang -o print_devices print_devices.c

Example output

@jkuri
jkuri / README.md
Created Mar 25, 2018
Output all video capture devices with all video modes available on MacOS using AVFoundation framework
View README.md

Output all video capture devices with all video modes available on MacOS using AVFoundation

Compile program using:

clang -o video_capture_devices video_capture_devices.m -framework Foundation -framework AVFoundation -framework CoreMedia

Sample output:

View EventEmitter.cpp
//
// Copyright (c) 2014 Sean Farrell
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
@jkuri
jkuri / cv2ff.cpp
Created Jan 16, 2018 — forked from yohhoy/cv2ff.cpp
Convert from OpenCV image and write movie with FFmpeg
View cv2ff.cpp
/*
* Convert from OpenCV image and write movie with FFmpeg
*
* Copyright (c) 2016 yohhoy
*/
#include <iostream>
#include <vector>
// FFmpeg
extern "C" {
#include <libavformat/avformat.h>
@jkuri
jkuri / tcp_server.c
Created Dec 26, 2017 — forked from oleksiiBobko/tcp_server.c
Simple socket server in C using threads (pthread library) Compiles on linux
View tcp_server.c
/*
C socket server example, handles multiple clients using threads
Compile
gcc server.c -lpthread -o server
*/
#include<stdio.h>
#include<string.h> //strlen
#include<stdlib.h> //strlen
#include<sys/socket.h>
@jkuri
jkuri / proxy.go
Created Nov 16, 2017 — forked from vmihailenco/proxy.go
Simple TCP proxy in Golang
View proxy.go
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
@jkuri
jkuri / README
Created Oct 20, 2017 — forked from rkusa/README
Install alpine linux on xhyve VM
View README
# curl -LO http://wiki.alpinelinux.org/cgi-bin/dl.cgi/v3.3/releases/x86_64/alpine-3.3.1-x86_64.iso
curl -LO http://wiki.alpinelinux.org/cgi-bin/dl.cgi/v3.3/releases/x86/alpine-3.3.1-x86.iso
# create hdd image (8GB)
dd if=/dev/zero of=hdd.img bs=1g count=8
# extract kernel and initramfs
brew install cdrtools
isoinfo -i alpine-3.3.1-x86.iso -J -x /boot/initramfs-grsec > initramfs-grsec
isoinfo -i alpine-3.3.1-x86.iso -J -x /boot/vmlinuz-grsec > vmlinuz-grsec
@jkuri
jkuri / animate_values.js
Created Aug 24, 2017 — forked from XerxesNoble/animate_values.js
Basic javascript linear value animation that can accept easing functions and provides update & complete callbacks
View animate_values.js
/**
* @desc Basic linear value animation that can accept simple easing functions and provides update & complete callbacks
* @param {Object} values - Object with numerical values. eg. { value1: 0, value2: 20, someKey: 55 }
* @param {Number} duration - How long (in milliseconds) the animation will be
* @param {Object} options - target values, update callback & complete callback
* @param {Function} [options.onComplete=(values) => values] - Callback that fires once animation is complete
* @param {Function} [options.onUpdate=(values) => values] - Callback that fires when animation frame updates
* @param {Function} [options.ease=(t) => t] - easing method eg. https://gist.github.com/gre/1650294
* @example
*
View ts-test.js
const options = require(path.resolve(process.cwd(), 'src', 'tsconfig.json')).compilerOptions;
const tsOpts = ts.parseJsonConfigFileContent({ compilerOptions: options, files: [] }, null, null).options;
const tsFiles = glob.sync('**/*.ts', {
cwd: path.resolve(process.cwd(), 'src')
});
const tsServiceHost = new ServiceHost(tsOpts, tsFiles, tsFiles);
const tsService = ts.createLanguageService(tsServiceHost, ts.createDocumentRegistry());
const output = tsFiles.map(file => {
return tsService.getEmitOutput(file);
});
You can’t perform that action at this time.