Skip to content

Instantly share code, notes, and snippets.

View brendan-rice's full-sized avatar

Brendan Rice brendan-rice

View GitHub Profile
DECLARE @propertyAlias NVARCHAR(50);
DECLARE @search NVARCHAR(50);
SET @propertyAlias = 'bodyText';
SET @search = 'whatever';
SELECT
n.id,
n.path,
n.text
/// <summary>
/// Handles the login form when user posts the form/attempts to login
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
public ActionResult HandleLogin(LoginViewModel model)
{
if (!ModelState.IsValid)
{
using System;
using Umbraco.Core;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.DatabaseAnnotations;
namespace Umbraco.Examples
{
/// <summary>
/// Class that shows the use of creating a new table and inserting a new ArticlePoco.
/// This class is only intended for demo'ing and should not be used as it.

Website Contract [month] [year]

Description of this Contract

This contract is not meant to trick or deceive you; the intention is purely to protect both parties. I have tried to keep the wording as plain as possible, but if anything is unclear, please let me know and I will be more than happy to clarify it with you. Also, until you sign it, please feel free to request to change bits of it to suit your requirements.

In short, [client name] is contracting me, [my name], to [description of my role] between [start date and finish date].

By signing this, you are confirming that you have the power and ability to enter into this contract on behalf of [client's company].

@brendan-rice
brendan-rice / gist:7816533
Created December 6, 2013 00:15
SQL Server Postcodes
CREATE TABLE dbo.Postcodes (
Postcode varchar(5) NOT NULL PRIMARY KEY,
Eastings int NOT NULL DEFAULT '0',
Northings int NOT NULL DEFAULT '0',
Latitude decimal(12,5) NOT NULL DEFAULT '0.00000',
Longitude decimal(12,5) NOT NULL DEFAULT '0.00000',
Town varchar(255) DEFAULT NULL,
Region varchar(255) DEFAULT NULL,
CountryCode varchar(3) NOT NULL,
Country varchar(16) NOT NULL
.module {
some: stuff;
&__child {
blah: blah;
}
&--modifier {
modify: me;
}
}

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "your_email@example.com". Th
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
@brendan-rice
brendan-rice / javascript_resources.md
Created August 27, 2014 14:12 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@brendan-rice
brendan-rice / css_resources.md
Created August 27, 2014 14:12 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides