Skip to content

Instantly share code, notes, and snippets.

View tiesont's full-sized avatar

Tieson Trowbridge tiesont

View GitHub Profile
@cassioeskelsen
cassioeskelsen / RenderViewToString.cs
Created February 17, 2011 11:50
Render a Asp.Net MVC View (Razor) to string
/*
* Original Sample: http://craftycodeblog.com/2010/05/15/asp-net-mvc-render-partial-view-to-string/
*/
public class HomeController : Controller
{
public ActionResult Index()
{
string MyModelData = "";
@cuu508
cuu508 / ExpandablePanel.java
Created April 28, 2011 23:37
Expandable Panel Android widget -- WIP
package com.example.myapp.widgets;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.Transformation;
import android.widget.LinearLayout;
@dieseltravis
dieseltravis / iisexpress.bat
Last active January 5, 2016 13:35
Add a shortcut to your Send To menu to launch a folder in IISExpress
@echo off
:: normalize folder
SET folder=%~1
IF %folder:~-1%==\ SET folder=%folder:~0,-1%
:: random number from 8000 to 9999
SET /a port=(%random%)*1999/32767+8000
:: start the web server for the random port starting at the passed-in directory
@scottlowe
scottlowe / OpenSslAes.cs
Created November 30, 2011 23:38
OpenSSL AES CBC 256 in .NET for interop with Ruby
using System;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace dotnet_aes
{
public class OpenSslAes
{
@bernos
bernos / index-with-amd.html
Created February 8, 2012 03:53
A javascript module template which supports an AMD loader (like requirejs) when available, but fails over to adding the module to a specified root context when an AMD loader is not available.
<!doctype html>
<html lang="en">
<head>
<title></title>
</head>
<body>
<script data-main="main-with-amd" src="requirejs-1.0.4.min.js"></script>
</body>
</html>
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@jfoshee
jfoshee / ListPickerViewModel.cs
Created March 22, 2013 19:20
Implementation of MonoTouch (Xamarin.iOS) UIPickerViewModel for an IList<T>.
namespace Unplugged
{
public abstract class ListPickerViewModel<TItem> : UIPickerViewModel
{
public TItem SelectedItem { get; private set; }
IList<TItem> _items;
public IList<TItem> Items
{
get { return _items; }
@CADbloke
CADbloke / VisualStudioSolutionSLNstyler.xml
Last active December 2, 2023 12:33
Notepad++ Syntax Highlighting for visual Studio .sln Solution files. Exported from NP++ 6.3.2To use, save this gist as an XML file, NP++ Language menu ==> Define your Language ==> click Import in the window that just popped up...then change the colo(u)rs in the pop-up window dialogues to something that offends you less.
<NotepadPlus>
<UserLang name="SLN" ext="sln" udlVersion="2.1">
<Settings>
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">03 04 00# 01 02</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
@danro
danro / remove-video.js
Created June 6, 2013 23:33
Remove HTML5 video and clear src attribute to prevent leaks.
// remove audio + video + stop all the downloadin’
// assumes $video and $audio are jQuery selectors for <video> and <audio> tags.
var removeMedia = function () {
_.each([$video, $audio], function ($media) {
if (!$media.length) return;
$media[0].pause();
$media[0].src = '';
$media.children('source').prop('src', '');
$media.remove().length = 0;
});
@Maarten88
Maarten88 / SiteController.cs
Created July 19, 2013 16:28
ASP.NET MVC ROBOTS.TXT and Sitemap.xml implementations
using Auction.Web.Domain.Queries;
using Auction.Web.Models;
using Auction.Web.Utility;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;