Skip to content

Instantly share code, notes, and snippets.

View xeb's full-sized avatar

Mark Kockerbeck xeb

View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml;
using System.Collections;
namespace Add2Project
{
/*!
* jQuery.math v1.0
* http://epicapp.com/jquery.math
*
* Copyright (c) 2009 Mark Kockerbeck
* Dual licensed under the MIT and GPL licenses.
*/
(function($){
$.math = { version: 1.0 }
using System.Text.RegularExpressions;
//Tony ***** H19 08/24/2009
namespace App_Code
{
public class PasswordStrength
{
public string DoesPasswordMeetBusinessRules(string strPasswordToTest)
{
// Password Rules ***************************************
@xeb
xeb / Node.js File Stream
Created August 23, 2011 06:54
Ha! Reading a file in Node... don't forget the toString!
var
sys = require("sys")
, fs = require("fs")
, path = require("path")
, exec = require("child_process").exec
;
console.log("Staring");
var file = __dirname + "\\input.txt";
console.log("reading " + file);
@xeb
xeb / gist:3521416
Created August 30, 2012 01:21
JsonFormatter
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Json;
using System.Text;
public static class SerializationExtensions
{
public static string ToJson<T>(this T obj)
@xeb
xeb / xamarin_switch.py
Last active December 19, 2015 03:28
A quick script to automatically change the Xamarin Studio Apple SDK from Xcode4 (for iOS 5.1 development) to Xcode5 (for iOS 7.0 development). The script will also automatically update the first (and only) csproj in the current directory and finally launch Xamarin Studio with the desired configuration.
#!/usr/bin/python
import sys, os, re
import getpass, getopt
import xml.etree.ElementTree as ET
pref_xcode4_loc = "/Applications/Xcode.app"
pref_xcode5_loc = "/Applications/Xcode5-DP.app"
pref_loc = "/Users/%s/Library/Preferences/XamarinStudio-4.0/MonoDevelopProperties.xml" % (getpass.getuser())
pref_key = "MonoDevelop.MacDev.AppleSdkRoot"
@xeb
xeb / xamarin_tree_clean.py
Created July 2, 2013 05:42
A quick script to clean the hierarchy of .xib files as they related to .cs and .designer.cs files
#!/usr/bin/python
import sys, os
import xml.etree.ElementTree as ET
from xml.etree.ElementTree import Element
namespace = "http://schemas.microsoft.com/developer/msbuild/2003"
def find_files_with_ext(extension):
return [f for f in os.listdir('.') if os.path.isfile(f) and os.path.splitext(f)[1] == extension]
@xeb
xeb / gist:6257472
Last active December 21, 2015 05:29
Marks system navigation
export MARKPATH=$HOME/.marks
function jump {
cd $MARKPATH/$1 2> /dev/null || echo "No such mark: $1"
}
function mark {
mkdir -p $MARKPATH; ln -s $(pwd) $MARKPATH/$1
}
function unmark {
rm -i $MARKPATH/$1
}
package main
import (
"fmt"
"io"
"net"
"os"
)
func main() {
@xeb
xeb / gist:7924287
Created December 12, 2013 07:19
Reset homebrew
cd `brew --repository`
git reset --hard HEAD
brew update
Sometimes the above doesn't work. In that case, do
cd `brew --repository`
git reset --hard origin/master
brew update