This file contains hidden or 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
| var crypto = require('crypto'); | |
| var data = "whatever"; | |
| var hashedValue = crypto.createHash('md5').update(data).digest("hex"); |
This file contains hidden or 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
| // Source: https://gist.github.com/jed/982883 | |
| // On the fly: | |
| (()=>([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,a=>(a^Math.random()*16>>a/4).toString(16)))() | |
| // Or define as named function: | |
| function a(){ | |
| return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,a=>(a^Math.random()*16>>a/4).toString(16)); | |
| } |
This file contains hidden or 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
| :: To start any powershell command on hidden mode, use: | |
| powershell -windowstyle hidden <command> |
This file contains hidden or 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 | |
| [-HKEY_CLASSES_ROOT\Directory\shell\runas] | |
| [HKEY_CLASSES_ROOT\Directory\shell\runas] | |
| @="Open command window here as Administrator" | |
| "HasLUAShield"="" | |
| [HKEY_CLASSES_ROOT\Directory\shell\runas\command] | |
| @="cmd.exe /s /k pushd \"%V\"" |
This file contains hidden or 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
| :: Create ad-hoc network in Windows via cmd: | |
| netsh wlan set hostednetwork mode=allow ssid=<network name> key=<password> | |
| netsh wlan start hostednetwork |
This file contains hidden or 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
| // Require libraries: | |
| const _ = require('lodash'); | |
| const mysql = require('mysql'); | |
| // Load configuration for DB server: | |
| var config = require('./config'); | |
| // Create DB connection object: | |
| var conn = mysql.createConnection(config.db); |
This file contains hidden or 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
| /** | |
| * Module dependencies. | |
| */ | |
| var express = require('../../'); | |
| var app = module.exports = express(); | |
| var logger = require('morgan'); | |
| var silent = 'test' == process.env.NODE_ENV; | |
| // general config |
This file contains hidden or 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
| # To hide the console, see: | |
| # https://gist.github.com/NitaiPerez/6d665465e0a6e7b63b21ce7e57fbf0cc | |
| # Sideload windows store app using .appxbundle file: | |
| # Enable sideload apps in settings (). | |
| Add-AppxPackage <app name>.appxbundle | |
| #Remove package: | |
| Remove-AppxPackage -package <package name> |
This file contains hidden or 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
| // Comfotability util for easy caching using Apps Script DocumentCache. | |
| // Uses md5 for cache keys. | |
| // See: https://developers.google.com/apps-script/reference/cache/cache | |
| var CACHE_INTERVAL = 21600; | |
| var docCache = CacheService.getDocumentCache(); | |
| function cacheSet(key, val){ | |
| return dcache.put(md5(key), JSON.stringify(val), CACHE_INTERVAL); // Max is: 21600 = 6hours |
This file contains hidden or 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
| // Use Angular service in console: | |
| // clientDetails service (get method): | |
| angular.element(document.body).injector().get('clientDetails').get(); | |
| // configAPI service (set method): | |
| angular.element(document.body).injector().get('configAPI').set(); | |
| // Also works with var: | |
| var configAPIService = angular.element(document.body).injector().get('configAPI'); | |
| configAPIService.set(); | |
| // View $rootScope in console: |