Ruby on Rails Cheatsheet
Architecture
Create a new application
Install the Rails gem if you haven't done so before
/* | |
Basic blocks of code that will build a CSV file using repsonse data from API calls | |
This is a "one-off" process, meaning you will | |
1. run Gatling script to generate CSV file using REST calls (usually POSTS, but GETS or datbase queries could work ) | |
2. copy the file into your project | |
3. compile and run Gatling | |
*/ | |
class MySimulation extends Simulation { |
Install the Rails gem if you haven't done so before
<!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> |
CSV FILE DIFF SCRIPT
USAGE:
python3 compare_csv_files.py
package performance.simulations.scenarios | |
import io.gatling.core.Predef._ | |
import io.gatling.http.Predef._ | |
import performance.simulations.lib.JenkinsParam._ | |
import performance.simulations.lib.RandomFeeder._ | |
import performance.simulations.lib.SharedHeaders._ | |
/** | |
* Created by nwhit8 on 9/21/15. |
#!bin/bash | |
yum install httpd -y | |
yum update -y | |
aws s3 cp s3://mywebbucket-cloudguru /var/www/html/ --recursive | |
service httpd start | |
chkconfig httpd on | |
What is the difference between "express": "^4.13.3" and "express": "~4.13.3" ? | |
What happens if I use `npm install <package> --save` instead of `npm install <package> --save-dev` ? |
/* | |
Take note of length - it is used as a String[] property > strings.length AND as a method for a String | |
array element > strings[i].length(). | |
*/ | |
public Map<String, String> pairs(String[] strings) { | |
Map<String,String> map = new HashMap<String,String>(); | |
for (int i = 0; i < strings.length; i++ ) { | |
if (strings[i].length() == 1 ) { | |
Character first = strings[i].charAt(0); |
/* MAVEN TO GRADLE */ | |
- Navigate to directory where the POM is located | |
- Run gradle init | |
> this will convert the Maven build to Gradle build (new settings.gradle & one or more build.gradle files) | |
/* GRADLE TO MAVEN */ | |
- Add Maven plugin to build.gradle file | |
ex. | |
apply plugin: 'java' |
// create an alternative method for getting a list of defined enums to avoid system creating a clone of the String array | |
// this is the .values() method | |
public enum Car { | |
TESLA, VOLVO, TOYOTA; | |
} | |
// normally what would happen | |
public static Car[] values() { | |
return (Car[])$VALUES.clone(); |