Skip to content

Instantly share code, notes, and snippets.

View xinmyname's full-sized avatar

Andy Sherwood xinmyname

View GitHub Profile
@xinmyname
xinmyname / mysignature.cs
Created January 27, 2011 22:44
my signature
using System;public class
Sig{public static void Main()
{for(int i=65;;i=i>82?65:i+9)
Console.Write((char)i);}}
@xinmyname
xinmyname / wsputil.psm1
Created March 17, 2011 21:00
WSP Utilities for SharePoint
# Magic fairy dust for working with WSPs and SharePoint 2010 in PowerShell
# So far, I've only tested this with event receivers, but I'll expand it
# as necessary.
function Get-WSPFeatures {
param($wspFilename = $(throw "Please specify a WSP file."))
$wspPath = (gci $wspFilename).FullName
$wsp = _wspExtractWSP $wspPath
@xinmyname
xinmyname / picmover.ps1
Created March 24, 2011 05:17
Move files from anywhere to somewhere else
$srcFolder = "W:\"
$dstFolder = "C:\Users\Andy\Temp\pics"
$extensions = ".jpg|.gif|.bmp"
get-childitem -r $srcFolder | where { $_.Extension -match $extensions } |% {
$src = $_
$srcName = $src.Name;
$srcFullName = $src.FullName
$year = $src.LastWriteTime.Year
$month = $src.LastWriteTime.Month
@xinmyname
xinmyname / svn-ignore.txt
Created April 13, 2011 15:18
Visual Studio related things you want SVN to ignore
*.ncb
*.suo
*.user
.hg
.hgignore
.hgsvn
_ReSharper.*
[Bb]in
obj
[Dd]ebug
@xinmyname
xinmyname / set-svnignore.ps1
Created April 13, 2011 15:20
Apply svn-ignore.txt file to a SVN repo (see https://gist.github.com/917726)
svn -R --depth immediates propset svn:ignore -F <path-to-svn-ignore-txt> <path-to-svn-repository>
@xinmyname
xinmyname / Examples
Created May 21, 2011 21:04 — forked from davidfowl/Examples
Powershell function that recursively walks all project items within a project and lets you execute an action on each one
# Print all project items
Recurse-Project -Action {param($item) "`"$($item.ProjectItem.Name)`" is a $($item.Type)" }
# Function to format all documents based on https://gist.github.com/984353
function Format-Document {
Recurse-Project -Action { param($item)
if($item.Type -eq 'Folder' -or !$item.Language) {
return
}
@xinmyname
xinmyname / lorem.txt
Created July 7, 2011 21:25
Lorem Ipsum Hannibalis
In 1972 a crack commando unit was sent to prison by a military court for a crime
they didn't commit. These men promptly escaped from a maximum security stockade
to the Los Angeles underground. Today, still wanted by the government, they survive
as soldiers of fortune. If you have a problem, if no one else can help, and if you
can find them, maybe you can hire the A-Team.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Gunnar Cam</title>
<link href="Index.min.css" type="text/css" rel="Stylesheet" />
</head>
<body>
<div id="image">
<img id="cam" src="http://192.168.1.201/image/jpeg.cgi" alt="Gunnar, most likely" />
</div>
@xinmyname
xinmyname / valueChanged.js
Created July 25, 2011 23:06
Debounce keyup in JavaScript
(function ($, ku)
{
var debounce = function (func)
{
var timeout;
var lastValue;
return function debounced()
{
var obj = this, args = arguments;
function delayed()
@xinmyname
xinmyname / ajaxtester.coffee
Created July 26, 2011 16:03
Beauty is in the eye of the beholder, or something...
testScadaTag = ->
$("#tagTest").attr("src", "/Content/blank.gif");
if (viewModel.scadaTag())
$("#tagTest").attr("src", "/Content/smallSpinner.gif")
$.ajax
url: "/Scada/Test/#{viewModel.scadaTag()}"
type: 'POST'
dataType: 'json'
error: (jqXHR, textStatus, errorThrown) ->
$("#tagTest").attr("src", "/Content/fail.png")