Skip to content

Instantly share code, notes, and snippets.

View richardadalton's full-sized avatar

Richard Dalton richardadalton

View GitHub Profile
@richardadalton
richardadalton / NewDevBox.txt
Last active August 29, 2015 14:13
NewDevBox
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
cinst visualstudio2013professional -InstallArguments "/Features:'Blend WebTools'"
cinst vs2013.4
cinst visualstudio2013-sdk
cinst visualstudio2013-modelingsdk
cinst sublimetext2
cinst virtualbox
cinst vagrant
@richardadalton
richardadalton / gist:014c2eeede38fb290ecd
Created September 18, 2015 10:13
Can I Make a Palindrome - Imperative vs Functional
Here's a little programming challenge, the kind you might be asked in a job interview.
Write a function that can tell if a sequence of characters can be rearranged to form a palindrome.
And here's a solution in C (The kind you might be expected to write in a job interview)
http://geeksquiz.com/check-characters-given-string-can-rearranged-form-palindrome/
bool canFormPalindrome(char *str)
{
// Create a count array and initialize all values as 0
@richardadalton
richardadalton / gist:61fd9e02a34398c78c217c4fd311fdf5
Created September 7, 2016 09:07
A simple generic Command/Query Agent in F# using MailboxProcessor
type Message<'S> =
| Query of ('S -> unit)
| Command of ('S -> 'S)
| Kill
type CQAgent<'S>(state: 'S) =
let innerModel =
MailboxProcessor<Message<'S>>.Start(fun inbox ->
let rec messageLoop (state: 'S) =
async {
@richardadalton
richardadalton / djangolight_onefile.py
Created February 27, 2017 07:29
Example of simplest possible Django Project
# Based on the book 'Lightweight Django'
# by Mark Lavin & Julia Elman
# See the following Repo for this example broken into multiple files.
# https://github.com/richardadalton/djangolight
import sys
from django.core.management import execute_from_command_line
from django.conf import settings
from django.conf.urls import url
<!DOCTYPE html>
<html>
<head>
<title>Page Title Here</title>
</head>
<body>
<h1>My Great Page</h1>
<p>A witty paragraph.</p>
</body>
</html>
<body>
<h1>My Great Page</h1>
<img src="img/jazzCats.jpg" />
</body>
<body>
<p>Rocket Drizzle salad</p>
<p>All about the Beets</p>
<p>Great bowl of Broccoli</p>
<p>Red Lentil Masala with Spinach</p>
<p>Peri Peri double Chicken</p>
</body>
<body>
<p class="veg">Rocket Drizzle Salad</p> <!--added veg classes-->
<p class="veg">All about the Beets</p>
<p class="veg">Great bowl of Broccoli</p>
<p class="veg main" Lentil Masala with Spinach</p><!--added veg and main classes-->
<p class="meat main">Peri Peri double Chicken</p> <!--added main and meat classes-->
</body>
.veg:before {
content: url(img/veggie.png) " "; /*whitespace added to distance icon from text*/
}
<!DOCTYPE html>
<head>
<title>Gastra Super Menu</title>
<style>
p {
font-family: "Lucinda Grande", "Lucinda Sans Unicode", Helvetica, Arial, Verdana, sans-serif;
}
.veg:before {
content: url(img/veggie.png) " "; /*whitespace added to distance icon from text*/
}