Skip to content

Instantly share code, notes, and snippets.

View greggnakamura's full-sized avatar

Gregg Nakamura greggnakamura

View GitHub Profile
@greggnakamura
greggnakamura / IIS: URL Rewrite Cheat Sheet
Last active November 14, 2015 00:30 — forked from developerdizzle/IIS Rewrite Cheat Sheet
IIS: URL Rewrite Cheat Sheet
<rewrite>
<!-- Have a bunch of redirects? Put them in a separate file -->
<rules configSource="Rewrites.config" />
<rules>
<!-- Simple rewrite -->
<rule name="Simple rewrite" stopProcessing="true">
<match url="^path/sub path/page\.aspx$" />
<action type="Rewrite" url="/newpath.aspx" />
@greggnakamura
greggnakamura / equal-height.js
Last active November 14, 2015 00:25 — forked from jbubriski/equal-height.js
jQuery: Equal heights custom script
var $mainNavItem = jQuery('#mainNav .two-column-nav');
jQuery($mainNavItem).on('mouseover', function () {
var mousedOver = jQuery.data(this, "mousedOver");
if (!mousedOver) {
var $this = jQuery(this);
var height = 0;
$siblings = $this.find('li.level2');
@greggnakamura
greggnakamura / README.md
Last active November 14, 2015 00:27 — forked from hofmannsven/README.md
Git: Using Git
(function ($) {
$(function () {
var $html = $('html');
var requests = 0;
function setBusy() {
if (++requests == 1) {
$html.addClass('busy-cursor');
}
}
public void NonQuery()
{
var connectionString = ConfigurationManager.ConnectionStrings["Default"].ConnectionString;
var sqlCommandText = "UPDATE People SET Name = 'John'";
using (var sqlConnection = new SqlConnection(connectionString))
using (var sqlCommand = new SqlCommand(sqlCommandText, sqlConnection))
{
sqlCommand.Connection.Open();
sub, sup {
/* Specified in % so that the sup/sup is the
right size relative to the surrounding text */
font-size: 75%;
/* Zero out the line-height so that it doesn't
interfere with the positioning that follows */
line-height: 0;
/* Where the magic happens: makes all browsers position
@greggnakamura
greggnakamura / index.html
Created December 21, 2012 15:30 — forked from anonymous/index.html
Countdown Clock
<div class="container">
<ul class="flip minutePlay">
<li>
<a href="#">
<div class="up">
<div class="shadow"></div>
<div class="inn">0</div>
</div>
<div class="down">
<div class="shadow"></div>
@greggnakamura
greggnakamura / peta_poco.cs
Created October 17, 2012 01:10 — forked from codeimpossible/peta_poco.cs
MVC: PetaPoco Example
[PetaPoco.TableName("People")]
[PetaPoco.PrimaryKey("Id")]
public class Person
{
public int Id { get; set; }
// .. some other fields
}
public ActionResult Create( Person person )
{
@greggnakamura
greggnakamura / JobsController.cs
Created October 9, 2012 00:51 — forked from codeimpossible/JobsController.cs
MVC: JobsController from Proggr; Implicitly cast to POCOs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Proggr.Controllers.Filters;
using Proggr.Controllers.Responses;
namespace Proggr.Controllers
{