Skip to content

Instantly share code, notes, and snippets.

@jamesrcounts
jamesrcounts / index.html
Last active August 29, 2015 14:17
Highlight Match Directive
<!DOCTYPE html>
<html>
<head>
<title>AngularJS Tutorials</title>
<link rel="stylesheet" href="//cdn.jsdelivr.net/foundation/5.4.7/css/foundation.css">
</head>
<body>
<div ng-app="myApp">
<!-- we've replaced the use of $scope with the preferred "controller as" syntax. see: http://toddmotto.com/digging-into-angulars-controller-as-syntax/-->
@jamesrcounts
jamesrcounts / starter.cmd
Created March 30, 2015 16:53
Minimal box starter
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
choco install googlechrome
Install-WindowsUpdate
Set-ExecutionPolicy -Force Unrestricted
@jamesrcounts
jamesrcounts / RecursiveSquare.java
Created April 16, 2015 15:48
Recursive Square Attempt
package org.teachingkidsprogramming.section05recursion;
import org.teachingextensions.logo.Tortoise;
public class RecursiveSquare
{
public static void main(String[] args) throws Exception
{
Tortoise.setSpeed(10);
double length = 100.0;
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=$HOME/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.com/install.sh | sh
@jamesrcounts
jamesrcounts / TortoiseReporter.py
Created June 5, 2015 17:59
Tortise Text Reporter for Python
from subprocess import call
from approvaltests.Reporter import Reporter
class TortoiseTextReporter(Reporter):
@staticmethod
def get_command(approved_path, received_path):
return ['C:\\Program Files\\TortoiseSVN\\bin\\tortoisemerge.exe', received_path, approved_path]
@jamesrcounts
jamesrcounts / 0.py
Created June 11, 2015 18:50
Python Challenge 0
url = "http://www.pythonchallenge.com/pc/def/%s.html"
print(url % 2**38)
@jamesrcounts
jamesrcounts / DevEnvDiffReporter.cs
Created March 16, 2012 02:36
A VS 11 DiffReporter for ApprovalTests
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ApprovalTests.Reporters
{
public class DevEnvDiffReporter : GenericDiffReporter
{
@jamesrcounts
jamesrcounts / BeyondCompareReporter.cs.patch
Created March 19, 2012 15:15
A patch that corrects GetPathInProgramFilesX86 behavior in a process compiled for x86
Index: BeyondCompareReporter.cs
===================================================================
--- BeyondCompareReporter.cs (revision 378)
+++ BeyondCompareReporter.cs (working copy)
@@ -20,7 +20,7 @@
public static string GetPathInProgramFilesX86(string path)
{
var x86Path = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + @"\" + path;
- return File.Exists(x86Path) ? x86Path : Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\" + path;
+ return File.Exists(x86Path) ? x86Path : Environment.GetEnvironmentVariable("ProgramW6432") + @"\" + path;
@jamesrcounts
jamesrcounts / CodeCompareReporter.patch
Created March 27, 2012 16:25
A DevArt CodeCompare DiffReporter for ApprovalTests
Index: ApprovalTests.sln
===================================================================
--- ApprovalTests.sln (revision 392)
+++ ApprovalTests.sln (working copy)
@@ -4,7 +4,7 @@
ProjectSection(SolutionItems) = preProject
ApprovalTests.build = ApprovalTests.build
ApprovalTests.vsmdi = ApprovalTests.vsmdi
- ApprovalTests3.vsmdi = ApprovalTests3.vsmdi
+ ApprovalTests1.vsmdi = ApprovalTests1.vsmdi
@jamesrcounts
jamesrcounts / README.md
Created April 20, 2012 17:09
A coffeescript finite state machine, just for fun. This machine implements a string.Contains() function.

Finite State Machine Revisited

This machine determines if a specified substring exists within a string. The initial machine is the first machine I wrote in CoffeeScript, so there should be plenty of room for improvement.

Also interesting, I think there is an opportunity for some meaningful use of CoffeeScript classes.

First we'll add a shim for alert.

alert = (value) -&gt; console.log value