Skip to content

Instantly share code, notes, and snippets.

@4E71
4E71 / pivotviewer_quickstart.cs
Created January 16, 2012 19:08
Silverlight: Getting started with SL5 PivotViewer
// Add reference to project
System.Windows.Controls.Pivot
// Create a Silverlight User Control and add the following namespace
xmlns:pivot="clr-namespace:System.Windows.Controls.Pivot;assembly=System.Windows.Controls.Pivot"
// Add PivotViewer control to page
<Grid x:Name="LayoutRoot" Background="White">
<pivot:PivotViewer x:Name="pivotViewer1">
<pivot:PivotViewer.PivotProperties>
@4E71
4E71 / aws_rdp.txt
Created January 18, 2012 04:05
AWS: How-To
# How to Initially RDP into EC2 Windows Instance
Assuming the default security group for an EC2 instance was selected during its initial setup, a new security rule must be created before the machine is accessible through RDP.
From the AWS Management Console select the Amazon EC2 tab. Then:
1) Select 'Security Groups' in the 'Navigation' pane
2) Select your security group (e.g., default)
3) Select the 'Inbound' tab
4) Select RDP from the 'Create a new rule:' dropdown.
5) Click the 'Add Rule' button
6) Click the 'Apply Rule Changes'
@4E71
4E71 / cache.dns
Created January 24, 2012 23:24
DNS: Location of DNS zone file in Windows Server 2K8 R2
%SystemRoot%\System32\DNS\
@4E71
4E71 / 1_define_test.cs
Created March 6, 2012 01:25
TDD: A simple example
// 1. Create a simple test method.
// Example test harness calls:
// public static void AlgUtil_Harness() {
// Test_CountTwos(232);
// Test_CountTwos(-232);
// }
private static void Test_CountTwos(int n) {
Console.WriteLine("The number of twos in {0} are: {1}", n, AlgUtil.CountTwos(n));
@4E71
4E71 / .gitignore_md
Created March 6, 2012 03:44
.gitignore for .NET projects
# MonoDevelop #
###############
bin/
*.userprefs
*.pidb
@4E71
4E71 / rvm_pygmantize.txt
Created March 6, 2012 08:03
RVM: Commands
# Prepare OSX to use Pygmantize.
# Assumes using RVM, multiple ruby versions installed, & gemset has been created.
# Commands are executed via bash.
# More Info: https://github.com/injekt/rack-pygmentize
# http://pygments.org/
ruby -v # Check ruby version. Default is ruby 1.8.7.
rvm 1.9.3-head # Switch to ruby version.
rvm gemset use SOME_GEMSET_NAME # Specify gemset to use.
sudo easy_install Pygments # Install Pygments.
@4E71
4E71 / bash.txt
Created March 12, 2012 00:14
bash: useful commands
cat /usr/share/dict/words > words.txt # Gets dictionary of words & saves to file.
@4E71
4E71 / replace.js
Created April 18, 2012 17:05
crm: js snippets
// Used to set text field with the value of a Lookup entity.
function Replace()
{
var lookupItem = new Array();
lookupItem = Xrm.Page.getAttribute("schema_field_name").getValue();
if (lookupItem != null)
{
var name = lookupItem[0].name;
}
@4E71
4E71 / 0) get_started.txt
Created July 4, 2012 02:03
django: getting started
# Django installation steps for OS X
# 1) install virtualenv and pip
curl -O https://raw.github.com/pypa/virtualenv/master/virtualenv.py
python virtualenv.py my_new_env
. my_new_env/bin/activate
(my_new_env)$ pip install ...
# 2) get the latest django source
git clone git://github.com/django/django.git django-trunk
@4E71
4E71 / developernotes.txt
Created July 25, 2012 23:51
visual studio: developer notes
Issue:
Try to load solution with a service project and get the following message:
"Creation of the virtual directory http://localhost:8888/service failed with the error:
Could not find the server 'http://localhost:8888' on the local machine.
Creating a virtual directory is only supported on the local IIS server."
Solution:
Edit the project file, look for <iisurl> node, remove the port number from the URL.
BEFORE: