Skip to content

Instantly share code, notes, and snippets.

View infomaven's full-sized avatar

Nadine Whitfield infomaven

  • Independent Software Developer
  • USA
View GitHub Profile
@dnozay
dnozay / _Jenkins+Script+Console.md
Last active May 3, 2024 09:33
jenkins groovy scripts collection.
@mburrows02
mburrows02 / CustomSimulation.scala
Last active April 18, 2023 23:23
Gatling simulation with dynamic scenarios and injection profiles
package test
import io.gatling.core.Predef._
import io.gatling.core.structure.PopulatedScenarioBuilder
import io.gatling.core.controller.inject.InjectionStep
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
import scala.concurrent.duration._
import scala.collection.mutable.ArraySeq
import org.json.JSONArray;
import org.json.JSONObject;
@thiagomgo
thiagomgo / lambda-curl.py
Created November 1, 2016 19:13
A simple lambda function written in python to execute a curl command
def lambda_handler(event, context):
import subprocess
result = subprocess.call("curl -I http://foo.bar", shell=True)
return result
@infomaven
infomaven / jsbin.uvecat.html
Last active May 7, 2021 12:40
JavaScript function that converts Hrs & Minutes into Decimal Hrs. It uses a Hash structure in Javascript to store the equivalencies. Intended audience: Use by Employees who need to enter Decimal time values for their time cards at work. Further down the line, this logic will be refactored into a Service that can be used programmatically by time-…
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta name="description" content="[add your bin description]" />
<meta charset=utf-8 />
<title>Decimalizer c.2013 - Nadine Whitfield</title>
</head>
<body>
@nremond
nremond / gist:2972382
Created June 22, 2012 12:10
Account feeder
class AccountFeeder() extends com.excilys.ebi.gatling.core.feeder.Feeder {
import org.joda.time.DateTime
import scala.util.Random
private val RNG = new Random()
// random number in between [a...b]
def randInt(a:Int, b:Int) = RNG.nextInt(b-a) + a
def daysOfMonth(year:Int, month:Int) = new DateTime(year, month, 1, 0, 0, 0, 000).dayOfMonth().getMaximumValue()
@infomaven
infomaven / Day.java
Last active January 4, 2016 01:02
Java classes for FileFestivalPlanner project. Download all source files to same directory, compile and run from FestivalMain class.
package src.main.java;
import java.util.Collections;
import java.util.List;
/**
* Created by nwhit8 on 11/1/15.
*/
public class Day {
anonymous
anonymous / jsbin.iyiwit.html
Created July 27, 2013 20:10
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
</body>
</html>
@infomaven
infomaven / CracklePop.scala
Last active November 8, 2015 21:51
Classic program that prints strings based on results of using MOD function against a List
/*
Write a program that prints out the numbers 1 to 100 (inclusive).
If the number is divisible by 3, print Crackle instead of the number.
If it's divisible by 5, print Pop. If it's divisible by both 3 and 5,
print CracklePop. You can use any language.
*/
/// any number x where x % y is divisible by that number. We'll use that fact to match boolean patterns in Scala.
//// In Scala RePL, copy-paste the function first. Then use the function in a second call from the REPL.
def listEval( number: Int ): String = (number % 3, number % 5 ) match {
/**
* Copyright 2011-2012 eBusiness Information, Groupe Excilys (www.excilys.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ctcarrier
ctcarrier / serviceTest1
Created April 23, 2012 16:09
Gatling scenario
import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Predef._
import scala.util.Random
import com.excilys.ebi.gatling.core.feeder.Feeder
class ServiceSimulation extends Simulation {
def apply = {
val random = new Random
random.setSeed(System.currentTimeMillis)