Skip to content

Instantly share code, notes, and snippets.

View danesparza's full-sized avatar
:octocat:
The best way to predict the future is to invent it - Alan Kay

Dan Esparza danesparza

:octocat:
The best way to predict the future is to invent it - Alan Kay
View GitHub Profile
@danesparza
danesparza / gist:1028204
Created June 15, 2011 21:44
Using CollectionAssert
// Assert:
// 1.) These items are not null
// 2.) These items are of type MyClass
// 3.) The expected collection is the same as the actual collection
CollectionAssert.AllItemsAreNotNull(actual);
CollectionAssert.AllItemsAreInstancesOfType(actual, typeof(MyClass));
CollectionAssert.AreEqual(expected, actual);
// Also:
// 4.) The collection we expect to be filled shouldn't be the same as the empty one
@danesparza
danesparza / gist:1007567
Created June 4, 2011 04:07
Using jQuery on Google's CDN with fallback
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript"> window.jQuery || document.write("<script src='/scripts/jquery-1.6.1.min.js'>\x3C/script>") </script>
@danesparza
danesparza / gist:977756
Created May 18, 2011 00:21
dig - additional section
;; ADDITIONAL SECTION:
a.mx.mail.yahoo.com. 1800 IN A 67.195.168.31
b.mx.mail.yahoo.com. 1800 IN A 74.6.136.65
d.mx.mail.yahoo.com. 1800 IN A 209.191.88.254
e.mx.mail.yahoo.com. 1800 IN A 67.195.168.230
f.mx.mail.yahoo.com. 1800 IN A 98.137.54.237
g.mx.mail.yahoo.com. 1800 IN A 98.137.54.238
h.mx.mail.yahoo.com. 1800 IN A 66.94.236.34
@danesparza
danesparza / gist:977753
Created May 18, 2011 00:20
dig - authority section
;; AUTHORITY SECTION:
yahoo.com. 5014 IN NS ns5.yahoo.com.
yahoo.com. 5014 IN NS ns2.yahoo.com.
yahoo.com. 5014 IN NS ns8.yahoo.com.
yahoo.com. 5014 IN NS ns1.yahoo.com.
yahoo.com. 5014 IN NS ns3.yahoo.com.
yahoo.com. 5014 IN NS ns6.yahoo.com.
yahoo.com. 5014 IN NS ns4.yahoo.com.
@danesparza
danesparza / gist:977734
Created May 18, 2011 00:12
dig - answer section
;; ANSWER SECTION:
yahoo.com. 1800 IN MX 1 l.mx.mail.yahoo.com.
yahoo.com. 1800 IN MX 1 m.mx.mail.yahoo.com.
yahoo.com. 1800 IN MX 1 n.mx.mail.yahoo.com.
yahoo.com. 1800 IN MX 1 a.mx.mail.yahoo.com.
yahoo.com. 1800 IN MX 1 b.mx.mail.yahoo.com.
yahoo.com. 1800 IN MX 1 d.mx.mail.yahoo.com.
yahoo.com. 1800 IN MX 1 e.mx.mail.yahoo.com.
yahoo.com. 1800 IN MX 1 f.mx.mail.yahoo.com.
yahoo.com. 1800 IN MX 1 g.mx.mail.yahoo.com.
@danesparza
danesparza / gist:977723
Created May 18, 2011 00:10
dig - question section
;; QUESTION SECTION:
;yahoo.com. IN MX
@danesparza
danesparza / gist:977715
Created May 18, 2011 00:06
dig - header section
; <<>> DiG 9.8.0-P1 <<>> yahoo.com MX
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23047
;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 7, ADDITIONAL: 7
@danesparza
danesparza / gist:977711
Created May 18, 2011 00:05
dig - mail servers
dig yahoo.com MX
; <<>> DiG 9.8.0-P1 <<>> yahoo.com MX
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23047
;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 7, ADDITIONAL: 7
;; QUESTION SECTION:
;yahoo.com. IN MX
@danesparza
danesparza / gist:977703
Created May 17, 2011 23:59
dig - reverse lookup
dig -x 97.74.104.201
; <<>> DiG 9.8.0-P1 <<>> -x 97.74.104.201
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24181
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 2
;; QUESTION SECTION:
@danesparza
danesparza / gist:977695
Created May 17, 2011 23:55
dig - specific dns server
dig @ns1.google.com www.google.com
; <<>> DiG 9.8.0-P1 <<>> @ns1.google.com www.google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30428
;; flags: qr aa rd; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0