Skip to content

Instantly share code, notes, and snippets.

# ----- Mirv https://github.com/Mirv 2021
# -- script is ps5 compliant
# -- stops on errors
# -- defaults to putting all one users group in list, then 2nd user's groups
# optional value to sort by sg name, just put y or any character at the end
#
# --- Requires being ran in powershell console 5 or 7
# - Use: Get-ADUserComparision id1 id2 {optionally -sort y}
function Get-ADUserComparision {
// Allow commandline parameters to be passed in NodeJS
module.exports = function(alternate_port){
var arguments = getCommandLine();
var arguments = arguments ? arguments : alternate_port;
if(!arguments){
throw "Arguments fed into inputHandler.js in both the commandline and parameter appear to be empty or null!";
}
return arguments;
}
@Mirv
Mirv / index.html
Created February 20, 2020 15:04
Vanilla JavaScript framework to create conversational bots
<!-- Star me on Github: https://github.com/ThibaultJanBeyer/ui-landing-bot -->
@Mirv
Mirv / cocoon.js
Last active March 5, 2019 23:16 — forked from thedanbob/cocoon.js
Cocoon rewrite in ES6 (WIP)
class Cocoon {
constructor (container, options) {
this.container = this.getNodeFromOption(container, false)
if (!this.container) {
throw new TypeError('Container must be supplied')
}
this.addFieldsLink = this.getNodeFromOption(options.addFieldsLink, container.querySelector('.add_fields'))
@Mirv
Mirv / directory_oader.rb
Created January 14, 2019 00:22
Uses require to load a sub-directory by adding sub to $LOAD_PATH
## Require (class)
#
# In: directory to require
# Out:
# Side: requires all the ruby files found
#
# Notes: Call via 'load_dir' or 'load_cur_dir'
#
module DirectoryLoader
class Require
3) Error:
RecipesControllerTest#test_should_destroy_recipe:
ActionController::UrlGenerationError: No route matches {:action=>"http://test.host/recipes/980190962", :controller=>"recipes"}
test/controllers/recipes_controller_test.rb:49:in `block (2 levels) in <class:RecipesControllerTest>'
test/controllers/recipes_controller_test.rb:47:in `block in <class:RecipesControllerTest>'
---log/test.log---
RecipesControllerTest: test_should_destroy_recipe
@Mirv
Mirv / gist:7aa8a21f5604c2499f07d2df6373c2e8
Created June 5, 2017 01:25
Error trying to use an integer in rails mini test
RecipeTest#test_recipe_is_valid:
NoMethodError: undefined method `each' for 3:Fixnum
test/models/recipe_test.rb:9:in `block in <class:RecipeTest>'
test "recipe is valid" do
recipe = Recipe.new(name: "SOMEONE", summary: "Something Else",
description: "Something Else", feeds: '3', prep_time: "90") ## -- This is the error line
assert recipe.valid?, 'recipe is not valid'
end