Skip to content

Instantly share code, notes, and snippets.

View zhengfish's full-sized avatar

zhengfish zhengfish

View GitHub Profile
@zhengfish
zhengfish / webcam_capture.c
Created April 14, 2022 00:40 — forked from mmozeiko/webcam_capture.c
Capture webcam device with Media Foundation API
#define COBJMACROS
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <mfapi.h>
#include <mfidl.h>
#include <mfreadwrite.h>
#include <stdio.h>
#include <intrin.h>
@zhengfish
zhengfish / gist:ac0507c130be811be0fa30425c63fc9a
Created September 27, 2019 07:48 — forked from RangelReale/gist:3e6392289d8ba1a52b6e70cdd7e10282
How to compile ffmpeg + x264 using Visual Studio 2015
##### How to compile ffmpeg + x264 using Visual Studio 2015 #####
##### Building this way will make the DLLs compatible with SEH, so there will be no need to use /SAFESEH:NO when compiling your code #####
##### SOURCES:
### https://pracucci.com/compile-ffmpeg-on-windows-with-visual-studio-compiler.html
### https://gist.github.com/sailfish009/8d6761474f87c074703e187a2bc90bbc
### http://roxlu.com/2016/057/compiling-x264-on-windows-with-msvc
* Download "MSYS2 x86_64" from "http://msys2.github.io" and install into "C:\workspace\windows\msys64"
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <uv.h>
#define DEFAULT_PORT 7000
#define DEFAULT_BACKLOG 128
@zhengfish
zhengfish / QuickSort.cpp
Created July 25, 2019 07:43 — forked from christophewang/QuickSort.cpp
Quick Sort in C++
#include <iostream>
void printArray(int *array, int n)
{
for (int i = 0; i < n; ++i)
std::cout << array[i] << std::endl;
}
void quickSort(int *array, int low, int high)
{
@zhengfish
zhengfish / iptables-cheatsheet.md
Created February 3, 2019 08:06 — forked from mcastelino/iptables-cheatsheet.md
iptables-cheatsheet

The netfilter hooks in the kernel and where they hook in the packet flow

The figure below calls out

  • The netfilter hooks
  • The order of table traversal
@zhengfish
zhengfish / minimal_vst2x_host.cpp
Created September 22, 2018 01:46 — forked from t-mat/minimal_vst2x_host.cpp
WIN32 : Minimal VST 2.x host in C++11.
// Win32 : Minimal VST 2.x Synth host in C++11.
//
// This is a simplified version of the following project by hotwatermorning :
// A sample VST Host Application for C++ Advent Calendar 2013 5th day.
// https://github.com/hotwatermorning/VstHostDemo
//
// Usage :
// 1. Compile & Run this program.
// 2. Select your VST Synth DLL.
// 3. Press QWERTY, ZXCV, etc.
@zhengfish
zhengfish / AdbCommands
Created September 10, 2018 02:22 — forked from Pulimet/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell