Skip to content

Instantly share code, notes, and snippets.

<input id="foo" type="text" value="javascript:disabled=true" /><br />
<input id="bar" type="text" value="javascript:readonly=true" /><br />
<input id="baz" type="text" value="javascript:readOnly=true" /><br />
<script type="text/javascript">
document.getElementById('foo').disabled = true;
document.getElementById('bar').readonly = true;
document.getElementById('baz').readOnly = true;
</script>
$ echo 'afoobarfoobar' > a.txt
$ echo 'xyzzyfoobarfoobarfoo' > b.txt
# Print all occurrences in all files
$ grep -o foo a.txt b.txt
a.txt:foo
a.txt:foo
b.txt:foo
b.txt:foo
b.txt:foo
@hudolejev
hudolejev / check_dns.php
Created June 20, 2013 17:24
Pingdom has an awesome feature to monitor DNS health: http://royal.pingdom.com/2007/11/01/new-pingdom-feature-dns-monitoring/. However, this doesn't work with round robin DNS. Here is one possible workaround:
// Usage: $dnsOk = check_dns('example.org', array('1.1.1.1', '2.2.2.2'));
function check_dns($domain, $ips) {
$result = true;
$dnsIps = array();
$dns = dns_get_record($domain, DNS_A);
foreach ($dns as $entry) {
$dnsIps[] = $entry['ip'];
}