Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# Build gstreamer for Raspberry Pi
# Edit the SRC and DEST environment variables at the top and then
# run this script. You'll need to add the following two envronment
# variables to your .profile
#
# LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${PREFIX}/lib"
# PATH="${PATH}:${PREFIX}/bin"
#
#!/bin/bash
export MAKEFLAGS="-j 3"
set -e
VERSION="1.16.0"
LIBNICE_VERSION="0.1.16" # libnice (v>=0.1.14) needed for webrtcbin
LIBSRTP_VERSION="2.2.0" # libsrtp (v>=2.2.0) required for srtp plugin
WEBRTCAUDIO_VERSION="0.3.1" # webrtc-audio-processing required for webrtcdsp
[ -n "$1" ] && VERSION=$1
@jonlabelle
jonlabelle / aspdotnet-razor-syntax-reference.md
Last active November 11, 2022 15:48
ASP.NET Razor Syntax Reference

ASP.NET Razor Syntax Reference

Code Block

@{
    int x = 123;
    string y = "because.";
}

Expression (Html Encoded)

@disnet
disnet / let_async.js
Last active December 31, 2015 04:28
sweet.js: async macro
let let = macro {
rule { async $vars ... = $fname ... ($params ...); $rest ...} => {
$fname ... ($params ..., function (err, $vars ...) {
if (err) throw err;
$rest ...
})
}
}
var buffer = new Buffer(1024);
@anaisbetts
anaisbetts / doc.md
Last active December 29, 2015 07:29
The smallest number of WinDbg commands you can know to Do Stuff With VS

File => Attach To Process, pick devenv.exe

First, fix the symbols and shit

.symfix
.reload
.loadby sos clr
@migueldeicaza
migueldeicaza / gist:7594491
Last active December 29, 2015 01:39
For David Fowler
These instructions will get you Mono compiled from source.
Requirements:
Xcode installed
Command Line Tools installed (part of Xcode)
Then, create a text file with the contents of everything after "=====", save it as "build.sh" in your home directory
Open a terminal window, and type this in your shell:
public class BetterDefaultModelBinder : DefaultModelBinder
{
protected override object CreateModel(ControllerContext controllerContext, ModelBindingContext bindingContext, Type modelType)
{
var model = base.CreateModel(controllerContext, bindingContext, modelType);
if (model == null || model is IEnumerable)
return model;
foreach (var property in modelType.GetProperties(BindingFlags.Public | BindingFlags.Instance))
@jordangray
jordangray / jquery.shimFormAction.coffee
Last active February 1, 2017 17:16
A simple shim for the HTML5 formaction attribute.
# Test for formaction attribute support in Modernizer.
Modernizr.addTest 'formaction', 'formaction' of document.createElement('input')
# Shim for formaction attributes on buttons and inputs.
$.fn.shimFormAction = ->
return this if Modernizr.formaction
this.each ->
$(this).find 'input,button'
.filter '[formaction!=""][formaction]'
@anaisbetts
anaisbetts / funcioc.cs
Created March 24, 2013 22:36
Literally everything I ever wanted out of an IoC container
public class FuncServiceLocator
{
Dictionary<Tuple<Type, string>, List<Func<object>>> _registry;
public void Register(Func<object> factory, Type type, string contract = null)
{
var pair = Tuple.Create(type, contract ?? "");
if (!_registry.ContainsKey(pair)) _registry[pair] = new List<Func<object>>();
_registry[pair].Add(factory);
@dannylloyd
dannylloyd / SQL Table to VB Class.sql
Last active December 15, 2015 02:58
Converts SQL table to VB class
declare @TableName sysname
set @TableName = 'TableName'
declare @Namespace varchar(50)
set @Namespace = 'Namespace'
declare @prop varchar(max)
PRINT 'Imports PetaPoco '
PRINT ''
PRINT 'Namespace ' + @Namespace
PRINT '<TableName("' + @TableName + '")>'