@{
int x = 123;
string y = "because.";
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let let = macro { | |
rule { async $vars ... = $fname ... ($params ...); $rest ...} => { | |
$fname ... ($params ..., function (err, $vars ...) { | |
if (err) throw err; | |
$rest ... | |
}) | |
} | |
} | |
var buffer = new Buffer(1024); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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]' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 + '")>' |
NewerOlder