Skip to content

Instantly share code, notes, and snippets.

function Start-ConnectionMonitoring
{
param($isp, $gateway, $Logfile,[int]$Delay = 10,[Ipaddress] $adapter, [switch]$ispPopup, [switch]$gateWayPopup)
$spacer = '--------------------------'
while($true)
{
if(!(Test-Connection $gateway -source $adapter -count 1 -ea Ignore))
{
get-date | Add-Content -path $Logfile
"$gateWay Connection Failure" |add-content -Path $Logfile
@cmaas
cmaas / basic.html
Last active February 3, 2021 15:55
HTML5 Page Templates: Basic & Social
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<link rel="stylesheet" href="css/style.css">
<link rel="icon" type="image/png" href="favicon.png">
</head>
@timelyportfolio
timelyportfolio / Readme.md
Last active May 27, 2017 05:55
vertical lines and labels with nvd3 + rCharts

rCharts + nvd3 with vertical lines and labels

In response to this Stack Overflow question I thought it would be helpful to demonstrate one way to add vertical lines and labels to a nvd3 time series lineWithFocusChart. Hopefully it will help both the R rCharts and the straight Javascript nvd3 user. I solved a small syncing problem with the brushing by adding a window.setTimeout on brushend. It seems to work fairly well.

Please let me know if there might be a better way to handle.

rCharts viewer demo

rCharts live code example

@gllist
gllist / gist:3668037
Created September 7, 2012 17:36 — forked from markstreich/gist:3667944
PhantomJS: Ajax response capture through console.log
var page = require('webpage').create();
page.open('http://www.website.com/', function (status) {
if (status === 'success') {
captureAjaxResponsesToConsole();
}
});
function captureAjaxResponsesToConsole() {
// logs ajax response contents to console so sublime's onConsoleMessage can use the contents
@jboner
jboner / latency.txt
Last active April 27, 2025 10:07
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD