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 T RandomItem() | |
{ | |
int randomRI = 0; | |
Random random = new Random(); | |
lock (random) | |
{ | |
randomRI = random.Next(0, this.Count - 1); | |
} | |
return this[randomRI]; | |
} |
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
' 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 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 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
/** | |
* Add this script to the end of your document that use <input autofocus type="text" /> | |
* or <input type="text" placeholder="username" /> and it'll plug support for browser | |
* without these attributes | |
* Minified version at the bottom | |
*/ | |
(function () { | |
function each(list, fn) { | |
var l = list.length; |
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
//dynamically generated by ASP.NET for the language passed in. | |
var labels = { | |
objectOverlay: { | |
closeX: 'Close X', | |
fallback: 'Video for {vid}' | |
}, | |
global: { | |
label1: 'label1', | |
label2: 'label2' | |
} |