Skip to content

Instantly share code, notes, and snippets.

View chuckleplant's full-sized avatar

Sergio Basurco chuckleplant

View GitHub Profile
@jennings
jennings / WcfExtensibilityPoints.md
Last active September 26, 2020 06:09
I can never remember how to extend WCF in the ways that I want.

A good summary of all the extensibility points: https://blogs.msdn.microsoft.com/carlosfigueira/2011/03/14/wcf-extensibility/

Doing stuff before/after calls

Use IOperationInvoker if you need to do "runtime-y" things, such as replacing the current SynchronizationContext (perhaps with one that restores OperationContext after an await...).

But! You can only apply an IOperationInvoker from an IOperationBehavior, not from a IServiceBehavior. If you try to assign an operation invoker from a service behavior, WCF will eventually just overwrite it. If you want to apply an IOperationInvoker to every operation in a contract, you can write an IServiceBehavior which applies the IOperationBehavior to every operation.

You can have an attribute which can apply to a whole service, or to a single operation:

@sailfish009
sailfish009 / ffmpeg_msvc.txt
Last active June 22, 2018 01:44
build ffmpeg static with visual studio 2015
0.visual studio 2015 update 2 ( 7 GB)
http://download.microsoft.com/download/1/2/1/1211d9dd-b504-47f2-90f2-20cb8b44e096/vs2015.2.ent_enu.iso
1. download ffmpeg source file
http://ffmpeg.org/releases/ffmpeg-3.0.2.tar.bz2
2. download msys2
http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20160205.exe
3. download yasm 64bit and copy it to /usr/bin/yasm.exe
@mantissa
mantissa / FrustumCulling.frag
Created April 6, 2014 01:03
Frustrum Culling with Shaders in OF
#version 120
uniform sampler2DRect pointsTexture;
uniform sampler2DRect resultsTexture;
uniform vec4 viewport;
uniform float width;
uniform mat4 mvMatrix;
varying vec4 texCoord0;
@devoncrouse
devoncrouse / clean_audio.sh
Created May 7, 2013 17:02
Using Sox (http://sox.sourceforge.net) to remove background noise and/or silence from audio files (individually, or in batch).
# Create background noise profile from mp3
/usr/bin/sox noise.mp3 -n noiseprof noise.prof
# Remove noise from mp3 using profile
/usr/bin/sox input.mp3 output.mp3 noisered noise.prof 0.21
# Remove silence from mp3
/usr/bin/sox input.mp3 output.mp3 silence -l 1 0.3 5% -1 2.0 5%
# Remove noise and silence in a single command