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
| (function (w) { | |
| var console = w.console, | |
| BenchLog = "", | |
| Bench = {}, | |
| BenchLogWrite = function (message) { | |
| if (console && console.log) { | |
| console.log(message); | |
| } else { // no console logger |
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 void ReorderItem(Guid itemToMoveID, int newOrder) | |
| { | |
| var db = new SomeDataContext(); | |
| var selectedItems = (from b in db.SomeItems | |
| where b.CategoryId == Category.SelectedCategoryID | |
| orderby b.OrderBy ascending | |
| select b).ToList(); | |
| SomeItem itemToMove = selectedItems.Find(b => b.ID == itemToMoveID); |
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
| // empty SPAN trimming code: | |
| var emptySpanTags = /<span(?:\b[^>]*)?><\/span>/gi; | |
| var noAttributeFilter = function () { | |
| // make sure the element has no elements | |
| if (this && this.attributes) { | |
| return (this.attributes.length <= 0); | |
| } | |
| return true; | |
| }; | |
| var trimPlainSpans = function (html) { |
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
| FOR /F "tokens=*" %%G IN ('DIR /B /AD /S *_svn*') DO RMDIR /S /Q "%%G" | |
| FOR /F "tokens=*" %%G IN ('DIR /B /AD /S *.svn*') DO RMDIR /S /Q "%%G" |
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
| ' VB.Net 2.0 | |
| ' a class for videos is what I was using my original code for | |
| Public Class Video | |
| Private _id As Integer | |
| Public Property Id() As Integer | |
| Get | |
| Return _id | |
| End Get | |
| Set(ByVal value As Integer) |
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
| // enumerate an object, ex: "window" | |
| (function(){ | |
| var enumObj = function(obj) { | |
| var props = ""; | |
| for (var o in obj) { | |
| props += o; | |
| props += ": \t"; | |
| props += obj[o]; | |
| props += "\n"; | |
| } |
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
| function EntityToNumeric(entity) { | |
| var obj = document.createElement("div"); | |
| obj.innerHTML = entity; | |
| return "&#" + (obj.textContent || obj.firstChild.nodeValue).charCodeAt(0) + ";"; | |
| } | |
| // usage: | |
| var html = "& ©®<>"; | |
| html = html.replace(/&\w+;/gi, EntityToNumeric); | |
| alert(html); // "& ©®<>" |
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
| // bookmarklet to introspect the source of current page | |
| javascript:(function(d,h){h=d.documentElement.innerHTML;d.open();d.write('<pre>'+('<!DOCTYPE html><html>'+h+'</html>').replace(/[<>]/g,function(m){return{'<':'<','>':'>'}[m]})+'</pre>')})(document); |
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
| /* | |
| * jQuery fasterTrim Plugin | |
| * version: 1.0.1 | |
| * @requires jQuery v1.0.x or later | |
| * | |
| * licensed under the MIT license: | |
| * http://www.opensource.org/licenses/mit-license.php | |
| * | |
| * @version $Id: jquery.fastertrim.js 2 2010-03-04 12:00:00Z $ | |
| * @author Travis Hardiman https://forum.jquery.com/user/travis.hardiman http://travis.servebeer.com |
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
| /* | |
| * jQuery fasterTrim Plugin | |
| * version: 1.0.5 | |
| * @requires jQuery v1.0.x or later | |
| * | |
| * dual licensed under the MIT and GPL licenses: | |
| * http://www.opensource.org/licenses/mit-license.php | |
| * http://www.opensource.org/licenses/gpl-2.0.php | |
| * | |
| * @version $Id: jquery.fastertrim.js 5 2010-03-12 12:00:00Z $ |