Posted: May 13th, 2011 | Author: Matt | Tags: .net, development, regex, snippet | No Comments »
string output = Regex.Replace("String 2 Parse 4 Non Numerics", "[^0-9]", string.Empty)
In this case the variable “output” will hold the value “24″
Posted: July 12th, 2010 | Author: Matt | Tags: javascript, regex, snippet | No Comments »
I used this in a simple reguar expression to strip html
An example of using this in a javascript function is as such…
function stripHtml(html)
{
return html.replace(/<(?:.|\s)*?>/g, "");
}
Posted: July 9th, 2010 | Author: Matt | Tags: javascript, snippet | No Comments »
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| function sample(options){
var settings = $.extend({
option1: null,
option2: null,
option3: null,
option4: null
},options||{}); //If no options, pass empty object
// using settings within function
console.log(settings.option1);
};
// calling the function
sample({option1: 'some value'}); |
Posted: May 15th, 2010 | Author: Matt | Tags: mysql, snippet | No Comments »
Because nothing works better for big fat nasty sql backups.
1
| mysql -uusername -ppassword dbname < name-of-data.sql |
Posted: May 12th, 2010 | Author: Matt | Tags: snippet, tips, virtualbox | No Comments »
VBoxManage internalcommands sethduuid /Volumes/External/VPC/bases/virtual_machine.vdi
Take that VirtualBox Virtual Hard Disk Manger… with all your not letting me add copies of my base virtual machines.