Skip to content

Instantly share code, notes, and snippets.

Get-ADUser -filter 'Name -like "*Prath*"' -Properties AccountExpirationDate | Select sAMAccountName, UserPrincipalName, distinguishedName, AccountExpirationDate
@raorao
raorao / hackery.md
Last active July 5, 2018 18:51
valueOf hackery.
obj = (function() {
  currentValue = 7
  return {
    valueOf: function() { return currentValue = currentValue+2 }
  }
})()

(obj < 10) && (obj > 10) //true
@StuPig
StuPig / water_ripple_canvas.js
Created February 8, 2014 02:27
Use JavaScript and canvas to create water ripple effect
/*
* Water Canvas by Almer Thie (http://code.almeros.com).
* Description: A realtime water ripple effect on an HTML5 canvas.
* Copyright 2010 Almer Thie. All rights reserved.
*
* Example: http://code.almeros.com/code-examples/water-effect-canvas/
* Tutorial: http://code.almeros.com/water-ripple-canvas-and-javascript
*/
@konijn
konijn / powerSet.js
Last active January 4, 2016 00:39
powerSet
function powerSet( list ){
var set = [],
listSize = list.length,
combinationsCount = (1 << listSize);
for (var i = 1; i < combinationsCount ; i++ , set.push(combination) )
for (var j=0, combination = [];j<listSize;j++)
if ((i & (1 << j)))
combination.push(list[j]);
return set;
@konijn
konijn / gist:4635185
Last active December 11, 2015 17:29
Log in the console all globals, still will not tell you where you created the global..
/* Dump all 'user space' globals
Many thanks to glutamat: http://stackoverflow.com/questions/14585537 */
void( (function()
{
var w = document.body.appendChild( document.createElement("iframe") ).contentWindow,
known =
[
"screenLeft" , "screenTop" , "scrollX" , "scrollY" , "pageYOffset" , "pageXOffset" , /* Scrolling related built-ins */
"innerWidth" , "innerHeight" , "outerWidth" , "outerHeight" , /* Size related built-ins */
"defaultstatus" , "defaultStatus", /* Status bar text related built-ins */
@jonjaques
jonjaques / bookmarklet.js
Last active August 30, 2023 06:52
jQuery Bookmarklet Template w/ Async Loading
// You create your bookmarklet by instantiating
// a new Bookmarklet function, then pass in the options like so.
// This example checks to see if the var is already defined, and makes
// sure not to overwrite it. This could happen if the user clicks on
// the bookmarklet more than once.
MyBookmarklet = MyBookmarklet || (MyBookmarklet = new Bookmarklet({
// debug: true, // use debug to bust the cache on your resources
css: ['/my/style.css'],
js: [],
@mydoghasworms
mydoghasworms / json_util.abap
Last active February 19, 2023 14:46
ABAP Utility class for mapping JSON to ABAP data and vice versa - Rather use https://gist.github.com/mydoghasworms/4888a832e28491c3fe47
* Rather use https://gist.github.com/mydoghasworms/4888a832e28491c3fe47
* The alternative is a better parser although it is not an emmitter)
*----------------------------------------------------------------------*
* CLASS json_util DEFINITION
*----------------------------------------------------------------------*
class json_util definition.
public section.
class-methods:
data_to_json importing data type any
returning value(json) type string,