Skip to content

Instantly share code, notes, and snippets.

@dei79
dei79 / verify-aad-token.js
Created June 8, 2015 18:28
Verifies an AAD token
var aad = require('azure-ad-jwt');
var jwtToken = '<<yourtoken>>';
aad.verify(jwtToken, null, function(err, result) {
if (result) {
console.log("JWT is valid");
} else {
console.log("JWT is invalid: " + err);
}
@dei79
dei79 / gist:f9711ec8fff9dac24ddb
Created October 11, 2014 09:46
Lock machine after autostart
@echo off
echo Locking Machine
rundll32.exe user32.dll,LockWorkStation
echo Starting tools....
ping 1.1.1.1 -n 1 -w 5000 > nul
echo All tools are started
pause
@dei79
dei79 / private.xml
Last active August 29, 2015 14:02
private.xml for keyremap4macbook with the goal of mapping my visual studio as good as possible to my MAC keyboard. (https://pqrs.org/macosx/keyremap4macbook/)
<?xml version="1.0"?>
<root>
<appdef>
<appname>RDP</appname>
<equal>com.microsoft.rdc.mac</equal>
</appdef>
<item>
<name>RDP Session MAC Mapping</name>
@dei79
dei79 / demo.html
Created October 27, 2012 17:01
Ensure two div-elements will get the same height (jquery solution)
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
<script>
$(function() {
function normalizeHeight($left, $right)
{
// get the max height of the two divs
var $maxHeight = Math.max($left.height(),$right.height())
@dei79
dei79 / exs4-autosetup
Created July 5, 2012 13:19
Hetzner autosetup for XenServer preparation
## ===================================================
## Hetzner Online AG - installimage - standardconfig.
## ===================================================
## ====================
## HARD DISK DRIVE(S):
## ====================
@dei79
dei79 / certify.rb
Created April 24, 2012 21:04
Adding before_filter handler to the certify controllers
Certify::AuthoritiesController.before_filter :backend_rights_required
Certify::CertificatesController.before_filter :backend_rights_required