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 static void PreventDoubleClick(Page page, Button button, string message) | |
{ | |
StringBuilder sb = new StringBuilder(); | |
sb.Append("if (typeof(Page_ClientValidate) == 'function') { "); | |
sb.Append("if (Page_ClientValidate() == false) { return false; }} "); | |
sb.Append("this.value = '" + message + "';"); | |
sb.Append("this.disabled = true;"); | |
sb.Append(page.ClientScript.GetPostBackEventReference(button, String.Empty)); | |
sb.Append(";"); | |
button.Attributes.Add("onclick", sb.ToString()); |
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
define( | |
// template dependency | |
[ | |
'app/text!app/views/templates/myMustacheTemplate.html', | |
'Scripts/mustache/mustache', | |
'Scripts/jquery', | |
'Scripts/jquery-ui-1.8.13.min', | |
'app/services/myServiceFile' | |
], |
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
/* | |
The filter property below is causing a parse error. | |
*/ | |
.push-status.cancelled .progress { | |
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#00E85734', EndColorStr='#00E85734'); | |
} | |
/* When I ran it I got this (keep reading to see my solution */ | |
/* An error occurred while compiling the Sass file. Details: |
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
// load per-page functionality | |
var $dataPage = $('body').attr('data-page'); | |
if ($dataPage) { | |
//note, there is no '.js' on the end of $dataPage | |
require(['app/pages/' + $dataPage]); | |
} |
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
//I took out the file input part and replaced it with an array. That would cut out the file I/O parts | |
//and cut down the time needed to complete it. | |
Create a C# program that solves the following dependency problem: | |
A person needs to figure out which order his/her clothes need to be put on. The person | |
creates a file that contains the dependencies. | |
This input is a declared array of dependencies with the [0] index being the dependency | |
and the [1] index being the item. |
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
////Specs | |
describe('Triangle Classify',function(){ | |
describe('Classify', function() { | |
it('On passing 3 different lengths returns scalene', function() { | |
expect(classify(3, 4, 5)).toBe(types.s); | |
}); | |
it('On passing 2 equal lenghts returns isosceles', function() { | |
expect(classify(3,3,2)).toBe(types.i); | |
expect(classify(3,2,3)).toBe(types.i); | |
expect(classify(2,3,3)).toBe(types.i); |
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
2012 Conferences | |
Past: | |
1/11-13 CodeMash | |
1/24-25 Node Summit | |
3/9-17 SxSW | |
3/15-17 CodePalousa | |
4/2-3 JSConf (AZ) | |
4/23 Kalamazoo X |
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
define( | |
['app/text!app/views/templates/item-list.html', 'app/views/listing-page'], | |
function(itemTpl, listingPageVw) { | |
var listing = listingPage.initialize($('.listing-page'), { | |
storeUrl: 'Item/All', | |
template: itemTpl, | |
usePaging: 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
INPUT = "./input/1.txt" | |
TARGET = 250000 | |
DAYS_LEFT = 7 | |
PEOPLE = [ | |
{:name => "I", :perDay => 1, :yield => 1.0}, | |
{:name => "My son", :perDay => 2, :yield => 0.95}, | |
{:name => "My brother", :perDay => 3, :yield => 0.85}, | |
{:name => "My niece", :perDay => 4, :yield => 0.60} | |
] | |
LINES = File.open(INPUT, "r").read.strip.split("\n").collect{|s| s.to_i} |
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
Nokogiri::HTML.parse(open(url)).css('.tn a').collect {|img| img["href"]} | |
#open(url) - opens and returns an html document | |
#css('selector') is just like jquery except server side. It returns a (ruby equivalent of a) linq-like enumerable | |
#collect is the same as .NET's select function | |
#So this one line when I set url to a Craigslist listing detail page will open that page and return an array of images for that listing. |
OlderNewer