This file contains hidden or 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
| /** | |
| * @private | |
| */ | |
| protected function mouseClickHandler(event:MouseEvent):void | |
| { | |
| selectedItem=item.data; | |
| moveSelectedThumbToCenter(); | |
| } | |
This file contains hidden or 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
| /* Simple JavaScript Inheritance | |
| * By John Resig http://ejohn.org/blog/simple-javascript-inheritance/ | |
| * MIT Licensed. | |
| */ | |
| // Inspired by base2 and Prototype | |
| (function(){ | |
| var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; | |
| // The base Class implementation (does nothing) | |
| this.Class = function(){}; | |
This file contains hidden or 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
| fill_pages(site, urlset) | |
| fill_legacy(urlset) | |
| sitemap.add_element(urlset) | |
| # File I/O: create sitemap.xml file and write out pretty-printed XML | |
| unless File.exists?(site.dest) | |
| FileUtils.mkdir_p(site.dest) | |
| end | |
| file = File.new(File.join(site.dest, SITEMAP_FILE_NAME), "w") | |
| formatter = REXML::Formatters::Pretty.new(4) |
This file contains hidden or 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
| it("convertToSplitDate should turen a Date into a split date", function() { | |
| var date = new Date(2012, 10, 17), | |
| splitDate = dateUtil.convertDateToSplitDate(date); | |
| expect(splitDate).toBeDefined(); | |
| expect(splitDate.year).toBe(date.year); | |
| expect(splitDate.month - 1).toBe(date.month); | |
| expect(splitDate.day).toBe(date.day); | |
| }); |
This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| """ | |
| Builds epub book out of Paul Graham's essays: http://paulgraham.com/articles.html | |
| Author: Ola Sitarska <[email protected]> | |
| This script requires python-epub-library: http://code.google.com/p/python-epub-builder/ | |
| """ | |
| import re, ez_epub, urllib2, genshi |
This file contains hidden or 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 machine = { | |
| initial: 'state/STARTING', | |
| states: [ | |
| { | |
| name: 'state/STARTING', | |
| transitions: [ | |
| { | |
| action: 'action/completed/STARTED', | |
| target: 'state/CONSTRUCTING' //name of the state to move to when event received | |
| }, |
This file contains hidden or 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
| //this is an event dispatcher at its bare minimum. | |
| var EventDispatcher; | |
| (function () { | |
| "use strict"; | |
| /** | |
| * Minimal event dispatcher | |
| * @see http://stackoverflow.com/q/7026709/87002 | |
| * @constructor | |
| */ |
This file contains hidden or 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
| module.directive('validatePhone', function () { | |
| return { | |
| require: 'ngModel', | |
| link: function (scope, elem, attr, ngModel) { | |
| function validatePhone(field) { | |
| //regex squirreled from here: http://blog.stevenlevithan.com/archives/validate-phone-number | |
| var regexObj = /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/; | |
| return regexObj.test(field); |
This file contains hidden or 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
| //from most to least verbose, but it is all the same in the end. | |
| (function() { | |
| var module = angular.module("myApp.myModel", []); | |
| var MyModel = function MyModel() { | |
| this.asyncService = null; | |
| this.someApi = function() { |
This file contains hidden or 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
| Run options: exclude {:org=>true} | |
| ......FFFF.FF.F | |
| Failures: | |
| 1) Quarto::Build stripping source code should eq "puts \"hello, world\nif true\n puts \"goodbye, world\nend\n" | |
| Failure/Error: expect(build.strip_listing(code)).to eq(<<END) | |
| expected: "puts \"hello, world\nif true\n puts \"goodbye, world\nend\n" | |
| got: "puts \"hello, world\n if true\n puts \"goodbye, world\n end" |