Skip to content

Instantly share code, notes, and snippets.

View pedoc's full-sized avatar
🎯
Focusing

pedoc pedoc

🎯
Focusing
View GitHub Profile
@TimSC
TimSC / vlcsms.c
Created November 20, 2012 22:59
Using libvlc to extract raw frames and audio from media via smem
//To compile:
//cc vlcsms.c -o vlcsms -lvlc
//This source is by Tim Sheerman-Chase and it is released as public domain.
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <inttypes.h>
#include <vlc/vlc.h>
@mjs3339
mjs3339 / BoyerMoore.cs
Last active February 17, 2022 07:11
C# High Performance Boyer Moore Byte Array Search Algorithm
public class BoyerMoore
{
private int[] _jumpTable;
private byte[] _pattern;
private int _patternLength;
public BoyerMoore()
{
}
public BoyerMoore(byte[] pattern)
{
using System;
using System.IO;
using System.Threading;
using System.Diagnostics;
namespace Born2Code.Net
{
/// <summary>
/// Class for streaming data with throttling support.
/// </summary>
@ufcpp
ufcpp / 16Bytes.cs
Last active November 15, 2022 18:52
A bit accessor for `byte`
// required packages:
// System.Runtime.CompilerServices.Unsafe
// System.Numerics.Vectors
using System;
using System.Collections;
using System.Collections.Generic;
using System.Numerics;
using System.Runtime.CompilerServices;
@apla
apla / build-chromium-windows.bat
Last active May 9, 2023 15:00
Build CEF# from source with mp4
@echo off
REM instructions from: https://groups.google.com/d/msg/cefsharp/BJLMXl9c204/HMJlp8mZzF0J
REM seems like partial instructions copied to SO: http://stackoverflow.com/questions/8033495/chromium-embedded-framework-mp3-support
REM all chromium releases: https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding.md#markdown-header-release-branches
REM 2272 - latest chromium with npapi (41)
REM there is a commits list: https://bitbucket.org/chromiumembedded/cef/branch/2272
REM https://github.com/cefsharp/CefSharp
REM cef builds http://www.magpcss.net/cef_downloads/
REM https://cefbuilds.com
@ceilfors
ceilfors / ssh-copy-id.py
Last active June 3, 2023 01:48
ssh-copy-id for Windows
"""ssh-copy-id for Windows.
Example usage: python ssh-copy-id.py ceilfors@my-remote-machine
This script is dependent on msysgit by default as it requires scp and ssh.
For convenience you can also try that comes http://bliker.github.io/cmder/.
"""
import argparse, os
from subprocess import call
public class EncryptingJsonConverter : JsonConverter {
private readonly byte[] _encryptionKeyBytes;
public EncryptingJsonConverter(string encryptionKey) {
if (encryptionKey == null) {
throw new ArgumentNullException(nameof(encryptionKey));
}
// Hash the key to ensure it is exactly 256 bits long, as required by AES-256
using (var sha = new SHA256Managed()) {
@ChadSki
ChadSki / gist:7992383
Last active August 16, 2023 15:45
Dynamically define C# value types (structs) at runtime with a dynamic assembly
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.InteropServices;
using System.Text;
namespace DevConsole
{
@P7h
P7h / Install_7zip_on_Linux.md
Last active October 4, 2023 04:46
7zip install on Linux -- Ubuntu and Fedora or CentOS / RHEL

Steps to install 7zip on Linux » Ubuntu and Fedora or CentOS / RHEL

Ubuntu

cat /etc/*release
sudo apt-get update -yqq
sudo apt-get install -yqq p7zip-full
@rajadain
rajadain / ConEmu-MaterialTheme.xml
Last active November 6, 2023 08:57
ConEmu Material Theme
<key name="Colors" modified="2015-12-10 22:46:43" build="151210">
<value name="Count" type="dword" data="00000001"/>
<key name="Palette1" modified="2015-12-10 22:46:43" build="151210">
<value name="Name" type="string" data="Material Theme"/>
<value name="ColorTable00" type="dword" data="004d4335"/>
<value name="ColorTable01" type="dword" data="006b60eb"/>
<value name="ColorTable02" type="dword" data="008de8c3"/>
<value name="ColorTable03" type="dword" data="0095ebf7"/>
<value name="ColorTable04" type="dword" data="00c4cb80"/>
<value name="ColorTable05" type="dword" data="009024ff"/>