Skip to content

Instantly share code, notes, and snippets.

View harvzor's full-sized avatar
🦙

Harvey Williams harvzor

🦙
View GitHub Profile
@harvzor
harvzor / Readme.markdown
Last active August 29, 2015 14:05
Sass (Bootstrap) Grid Mixin

A Sass equivilent to the Twitter Bootstrap Grid Mixin

What?

This is supposed to be an exact replica of Bootstrap Grid made by Twitter, except made in Sass.

Why?

Since the variables are easily editable, it means it is ideal for projects which all use the same mixins.. Simply change a couple of variables so the grid system can match the design template, and you're away!

But you can already get a customized version automatically built...

This is quicker.

Revisions

1

@harvzor
harvzor / index.html
Created August 20, 2014 11:37
JS Radio Selector
<label class="radio" for="nice_day_yes">Yes</label>
<input id="nice_day_yes" type="radio" name="nide_day" value="yes"/>
<span>/</span>
<label class="radio" for="nice_day_no">No</label>
<input id="nice_day_no" type="radio" name="nice_day" value="no"/>
@harvzor
harvzor / Domain.cs
Last active August 29, 2015 14:17 — forked from florisrobbemont/Domain.cs
Queries the Umbraco database and returns a list of either all domains, or all domains associated with a particular node ID.
/// <summary>
/// Represents a domain
/// </summary>
public class Domain
{
/// <summary>
/// Gets the unique domain id
/// </summary>
public int DomainId { get; set; }
@harvzor
harvzor / DownloadFile.cs
Last active August 13, 2018 20:41
Create a document type in Umbraco called Download File and put this code into the template. When you want a user to download a file, direct them to example.com/downloadfile?id=####. The ID query string must be equal to a media items ID.
using Umbraco.Web;
using System.Web.Http;
using System.Web;
using System.IO;
namespace Examples.Service
{
public class DownloadServiceController : Umbraco.Web.Mvc.SurfaceController
{
// Use this if you only want logged in users to access these methods.
.xs-flex { @include display-flex; }
.xs-order-1 { @include order(1); }
.xs-order-2 { @include order(2); }
.xs-order-3 { @include order(3); }
@media (min-width: 768px) {
.sm-flex { @include display-flex; }
.sm-order-1 { @include order(1); }
.sm-order-2 { @include order(2); }
.sm-order-3 { @include order(3); }
@harvzor
harvzor / packages-work.config
Last active September 13, 2021 10:50
Packages installed by Chocolatey.
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="7zip" />
<package id="7zip.install" />
<package id="audacity" />
<package id="autohotkey" />
<package id="autohotkey.install" />
<package id="autohotkey.portable" />
<package id="aws-iam-authenticator" />
<package id="awscli" />
@harvzor
harvzor / ViewRenderer.cs
Last active October 10, 2019 16:05
C# ViewRenderer
using System;
using System.Web;
using System.Web.Mvc;
using System.IO;
using System.Web.Routing;
namespace YourNamespace
{
/// <summary>
/// Class that renders MVC views to a string using the
@harvzor
harvzor / server.js
Last active January 17, 2023 00:32
IISNode basic setup
var express = require('express');
var app = express();
app.get('/', function (req, res) {
res.send('Express is working on IISNode!');
});
app.listen(process.env.PORT);
""""""""""""""""""""""""""""""""""""""""""""""""""
" Sections:
" -> General
" -> VIM user interface
" -> Colors and Fonts
" -> Files, backups and undo
" -> Text, tab and indent related
" -> Moving around, tabs and buffers
" -> Editing mappings
" -> Helper functions
@harvzor
harvzor / howto.md
Last active January 4, 2017 17:13
Rerouting public stuff in Umbraco

Allowing CSS and JS scripts to be stored somewhere else in an Umbraco website

You may want to cleanup the root of your website, but Umbraco assumes that CSS and JS are stored in the /css and /scripts folders respectively. Further more, you may want front end users to be able to access the files as if they were not stored somewhere else. Use this guide to find out how to move the CSS and JS into a /public folder without breaking anything.

Setting up

1 - Create a /public folder in the root of your website 2 - Move the /css and /scripts folder into the /public folder 3 - Add the following rewrite rule to the Web.config: