Skip to content

Instantly share code, notes, and snippets.

From 07f992c3a001a924ed62020b2b84d29d4dc5bbdd Mon Sep 17 00:00:00 2001
From: Gleb Dolgich <gleb@proggle.com>
Date: Sat, 7 Nov 2009 04:17:46 +0000
Subject: [PATCH] enabled coupon prefilling via search string
---
app/views/store/order/new.rhtml | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/app/views/store/order/new.rhtml b/app/views/store/order/new.rhtml
From 02b88e175db3b18f781a9e3e0798943661b595e4 Mon Sep 17 00:00:00 2001
From: Gleb Dolgich <gleb@proggle.com>
Date: Sat, 7 Nov 2009 20:28:28 +0000
Subject: [PATCH] gave priority to coupon code via URL over session
---
app/views/store/order/new.rhtml | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/app/views/store/order/new.rhtml b/app/views/store/order/new.rhtml
/*
Copyright (c) 2009 Remy Demarest
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
/*
Say you have a largeish C++ class. You want to use it from ObjC. ObjC++ is painful;
C++ is painful. .mm files are bad. How about if we could just treat that C++
object as an ObjC object whenever it exits C++ land?
Apple already solved this problem once with toll free bridging. The tricky part is
vtables -- with a vtable, isa isn't at offset 0 of the memory layout of the object.
The code below is a work in progress to work around this.
*/
/*
* $TM_FILENAME
* ${1:`echo "$TM_FILEPATH" | awk -F"/" '{x=NF-1}{print $x}'`}
*
* Created by `id -P | awk -F ":" '{ print $8 }'` on `date "+%d/%m/%Y"`.
*
* Copyright (c) 2009 ${2:$TM_ORGANIZATION_NAME}
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
using System;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Interop;
namespace Utility
{
public static class UserHelper
{
[DllImport("user32.dll")]
// in startup code
EventManager.RegisterClassHandler(
typeof (TextBox),
TextBox.GotFocusEvent,
new RoutedEventHandler(TextBox_GotFocus));
EventManager.RegisterClassHandler(
typeof(TextBox),
TextBox.GotKeyboardFocusEvent,
new RoutedEventHandler(TextBox_GotFocus));
@glebd
glebd / AutoFilteredComboBox.cs
Created May 6, 2010 16:00
WPF auto-filtering combo box
using System;
using System.ComponentModel;
using System.Globalization;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Input;
namespace BaControls
@glebd
glebd / SharpImage.xaml
Created May 24, 2010 11:07
Sharp bitmap image in XAML
<!-- Width, Height and Stretch ensure proper display of 72 dpi images -->
<Image Source="/MyProject;component/View/Resources/reddot.png"
RenderOptions.BitmapScalingMode="NearestNeighbor"
Stretch="Uniform"
Width="6"
Height="6"
Canvas.Left="0"
Canvas.Top="2"
HorizontalAlignment="Left"
VerticalAlignment="Top"/>
<ToggleButton Name="showStopsCheckBox">
<ToggleButton.Style>
<Style TargetType="{x:Type ToggleButton}">
<Setter Property="Content" Value="Stops"/>
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Content" Value="Trips"/>
</Trigger>
</Style.Triggers>
</Style>