This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/smtp' | |
class DotNetRocksMailer | |
def self.send_email(from, to, subject, message, attachmentFileName, mailServer) | |
filename = attachmentFileName | |
filecontent = File.read(filename) | |
fileNameOnly = File.basename(attachmentFileName) | |
encodedcontent = [filecontent].pack("m") # base64 | |
marker = "AUNIQUEMARKER" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CommandLineExecuter | |
def self.execute(cli,props = {},nameless_param) | |
parameters = props.collect { |key,value| "/#{key}=#{value}" }.join " " | |
exec("#{cli} #{nameless_param} #{parameters}") | |
end | |
end | |
#Sample usage | |
CommandLineExecuter.execute "notepad" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h3 my site | |
p hello | |
teaser this is my optional teaser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ServiceLocator | |
{ | |
//Some kind of singleton is here... | |
// only the stuff that matters | |
public static void For<T>(params Func<T>[] regs) | |
{ | |
// ... | |
} | |
public static T Use<T>() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sut = []; | |
if(!sut){ | |
console.log("An empty array is false"); | |
}else{ | |
console.log("An empty array is true"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ewa = null; | |
// Add event handler for onload event. | |
if (window.attachEvent) { | |
window.attachEvent("onload", ewaOnPageLoad); | |
} | |
else { | |
window.addEventListener("DOMContentLoaded", ewaOnPageLoad, false); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var browserLanguage = window.navigator.userLanguage || window.navigator.language; | |
var redirectTo = "http://www.google."; | |
// add some logic which will be executed based on users browser! language | |
switch (browserLanguage) { | |
case "de": | |
redirectTo = "http://www.bing.de"; | |
break; | |
default: | |
redirectTo += browserLanguage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href='foo.bar' class='my-link' target='_blank'>Foo</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chromeSettings = new ShareCoffee.ChromeSettings("", "My AutoHosted SharePoint App", | |
new ShareCoffee.SettingsLink("foo.html", "Foo", true), | |
new ShareCoffee.SettingsLink("bar.html", "Bar", true) | |
); | |
var onAppChromeLoaded = function () { | |
console.log("chrome should be loaded now!"); | |
}; | |
ShareCoffee.UI.loadAppChrome("chrome-placeholder-id", chromeSettings, onAppChromeLoaded); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.ExpertsInside = { | |
makeUpperString: function(input){ | |
return input.toUpperString(); | |
} | |
}; | |
if(window.attachEvent){ | |
window.attachEvent("onload", registerUserDefinedFunction); | |
}else{ | |
window.addEventListener("DOMContentLoaded", registerUserDefinedFunction, false); |
OlderNewer