Skip to content

Instantly share code, notes, and snippets.

David Inkpen davunderscorei

  • Avid Nano
  • London
Block or report user

Report or block davunderscorei

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View credit.js
function main() {
return credit();
}
function credit() {
var mainCyl = cylinder({ r: 10, h: 3 });
var upperCyl = cylinder({ r: 8.5, h: 0.5 }).translate([0, 0, 3]);
var lowerCyl = cylinder({ r: 9, h: 1 });
var outerDonut = difference(
cylinder({ r: 7.5, h: 0.5 }).translate([0, 0, 3]),
View kendall's code
public object Convert(object value, Type targetType, object parameter, CultureInfo culture, bool convertBack = false)
{
if (Converters.Count == 0 && value != null && value.GetType() == targetType)
{
return value;
}
foreach (IValueConverter converter in Converters)
{
object temp = converter.Convert(value, targetType, parameter, culture, convertBack);
if (temp != null)
View gist:10140568
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (Converters.Count == 0 && value != null && value.GetType() == targetType)
{
return value;
}
foreach (IValueConverter converter in Converters)
{
object temp = converter.Convert(value, targetType, parameter, culture);
if (temp != null)
View IsNumber.cs
public static bool IsNumber(string inValue)
{
bool result = false;
if (inValue == null) return result;
try
{
float myDT = float.Parse(inValue);
result = true;
}
View ;.txt
IL_0001: newobj UserQuery+Class..ctor
IL_0006: stloc.0
IL_0007: ldloc.0
IL_0008: ldc.i4.3
IL_0009: newobj UserQuery+MyObject..ctor
IL_000E: stfld UserQuery+Class.asdf
IL_0013: ldloc.0
IL_0014: call LINQPad.Extensions.Dump
Class..ctor:
@davunderscorei
davunderscorei / answer
Created Nov 15, 2012
booling enum arguments
View answer
public enum MyEnum { alpha, beta, gamma }
public void MyOuterFunction(bool a, bool b, bool c)
{
MyEnum asdf = MyEnum.alpha;
if(a) asdf &= ~MyEnum.alpha;
if(b) asdf |= MyEnum.beta;
@davunderscorei
davunderscorei / gist:4072398
Created Nov 14, 2012
protobuf-net multiple inheritance
View gist:4072398
//in order to do this
[ProtoContract]
public class Base
{
[ProtoMember(1)]
public int Value { get;set;}
}
[ProtoContract]
You can’t perform that action at this time.