obj = (function() {
currentValue = 7
return {
valueOf: function() { return currentValue = currentValue+2 }
}
})()
(obj < 10) && (obj > 10) //true
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
# This is a super **SIMPLE** example of how to create a very basic powershell webserver | |
# 2019-05-18 UPDATE — Created by me and and evalued by @jakobii and the comunity. | |
# Http Server | |
$http = [System.Net.HttpListener]::new() | |
# Hostname and port to listen on | |
$http.Prefixes.Add("http://localhost:8080/") | |
# Start the Http Server |
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
Get-ADUser -filter 'Name -like "*Prath*"' -Properties AccountExpirationDate | Select sAMAccountName, UserPrincipalName, distinguishedName, AccountExpirationDate |
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
/* | |
* 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 | |
*/ | |
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
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; |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Hello World! Site Title</title> | |
</head> | |
<body> | |
<h1>Hello World!</h1> | |
</body> |
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
/* 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 */ |
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
// 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: [], |
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
* 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, |