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 logicGates = { | |
nand: function (a, b) { | |
return !(a && b); | |
}, | |
not: function (a) { | |
return this.nand(a, a); | |
}, | |
and: function (a, b) { | |
return this.not(this.nand(a, b)); | |
}, |
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
type LogicGate = | |
| ON | |
| OFF | |
| NAND of LogicGate * LogicGate | |
| NOT of LogicGate | |
| AND of LogicGate * LogicGate | |
| OR of LogicGate * LogicGate | |
| NOR of LogicGate * LogicGate | |
| XOR of LogicGate * LogicGate | |
| XNOR of LogicGate * LogicGate |
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 NodeFilter = { | |
FILTER_ACCEPT: 1, | |
FILTER_REJECT: 2, | |
FILTER_SKIP: 3, | |
SHOW_ALL: -1, | |
SHOW_ELEMENT: 1, | |
SHOW_ATTRIBUTE: 2, | |
SHOW_TEXT: 4, | |
SHOW_CDATA_SECTION: 8, | |
SHOW_ENTITY_REFERENCE: 16, |
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 typs = {}; | |
(function (self) { | |
var values = [ | |
'Function', | |
'Object', | |
'Array', | |
'String', | |
'Number', | |
'Date', |
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
// http://www.dustindiaz.com/smallest-domready-ever | |
var ready = function (f) { | |
(/complete|loaded|interactive/.test(document.readyState)) ? | |
setTimeout('ready(' + f + ')', 9) : | |
f(); | |
}; |
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
#!/bin/sh | |
CURRENT_DIR=${PWD##*/} | |
git init | |
git add . | |
git commit -m "first commit" | |
pushd $1 | |
mkdir "$CURRENT_DIR.git" | |
cd "$CURRENT_DIR.git" |
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
' In the web.config | |
' | |
'<pages> | |
' <tagMapping> | |
' <clear /> | |
' <add tagType="System.Web.UI.WebControls.TextBox" | |
' mappedTagType="XSSTextBox"/> | |
' </tagMapping> | |
'</pages> |
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
/* | |
* IDENT_CURRENT returns the last identity value generated for a specific table in any session and any scope. | |
* @@IDENTITY returns the last identity value generated for any table in the current session, across all scopes. | |
* SCOPE_IDENTITY returns the last identity value generated for any table in the current session and the current scope. | |
*/ | |
IF OBJECT_ID(N't6', N'U') IS NOT NULL | |
DROP TABLE t6 ; | |
GO |
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 r = [], | |
n = 0, | |
a = 0, | |
b = 1, | |
next; | |
function nextFibonacci() { | |
next = a + b; | |
return b = (a = b, next); |
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 soundex = function (s) { | |
var a = s.toLowerCase().split(''), | |
f = a.shift(), | |
r = '', | |
codes = { | |
a: '', e: '', i: '', o: '', u: '', | |
b: 1, f: 1, p: 1, v: 1, | |
c: 2, g: 2, j: 2, k: 2, q: 2, s: 2, x: 2, z: 2, | |
d: 3, t: 3, | |
l: 4, |
OlderNewer