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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://www.dropbox.com/s/l6hgjq7mh52o6od/spiceworks-sdk.js?dl=1&raw=1" type="text/javascript"></script> | |
<script src="https://code.jquery.com/jquery-2.1.3.min.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
var card = new SW.Card(); | |
var inventory = card.services('inventory'); |
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
using EnvDTE; | |
using Microsoft.VisualStudio.TemplateWizard; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace LigerShark.Templates | |
{ |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Text; | |
using System.Web; | |
namespace ConsoleApplication4 | |
{ |
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
// Generate a random decimal number between 0 and 1 | |
var random = Math.random(); | |
// Generate a whole number between 0 and the max number; | |
var maxNumber = 10; | |
var random = Math.floor(Math.random() * maxNumber); // Will generate a whole number between 0 and 9 | |
// Generate random whole numbers within a given range | |
var min = 25; | |
var max = 38; |
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
/* | |
* Instructions: | |
* Remove all falsy values from an array. | |
* Falsy values in javascript are false, null, 0, "", undefined, and NaN. | |
*/ | |
function bouncer(arr) { | |
arr = arr.filter(function(val) { | |
return Boolean(val); | |
}); |
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
Weather.getCurrent("Kansas City", function(current) { | |
console.log( | |
["currently:",current.temperature(),"and",current.conditions()].join(" ") | |
); | |
}); | |
Weather.getForecast("Kansas City", function(forecast) { | |
console.log("Forecast High in Kelvin: " + forecast.high()); | |
console.log("Forecast High in Fahrenheit" + Weather.kelvinToFahrenheit( forecast.high() ); | |
console.log("Forecast High in Celsius" + Weather.kelvinToCelsius( forecast.high() ); |
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
Windows Registry Editor Version 5.00 | |
; | |
; Add context menu entry to Windows Explorer background | |
; | |
[HKEY_CLASSES_ROOT\Directory\Background\shell\powershell] | |
@="Open PowerShell window here" | |
"NoWorkingDirectory"="" | |
[HKEY_CLASSES_ROOT\Directory\Background\shell\powershell\command] |
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
map = L.map("transitmap", { | |
center: [ 34.730225, -86.585944 ], // Huntsville, AL | |
zoom: 15 | |
}); | |
L.tileLayer("http://korona.geog.uni-heidelberg.de/tiles/roads/x={x}&y={y}&z={z}", { | |
attribution: "© <a href='http://giscience.uni-hd.de/'>GIScience Research Group @ University of Heidelberg</a> © <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a>", | |
maxZoom: 20 | |
}).addTo( map ); |
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
Array.prototype.contains = function( value ) { | |
return this.indexOf( value ) > -1; | |
} |
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
Import-Module ActiveDirectory | |
$domain = Get-ADOrganizationalUnit -searchbase "DC=contoso, DC=com" -filter * -searchscope 1 | |
$total = 0 | |
foreach ($ou in $domain) | |
{ | |
$count = @(Get-ADUser -searchbase $ou -filter * |Where-Object {$_.enabled -eq "true"}).count | |
$total += $count | |
} |
OlderNewer