Skip to content

Instantly share code, notes, and snippets.

@duketon
duketon / keybase.md
Created July 25, 2016 22:51
Keybase proof

Keybase proof

I hereby claim:

  • I am duketon on github.
  • I am michaelkendra (https://keybase.io/michaelkendra) on keybase.
  • I have a public key whose fingerprint is 6C3D F156 60B8 6042 135E 61DB AAD0 11BC EF61 EE92

To claim this, I am signing this object:

#!/bin/bash
curl -XPUT http://localhost:9200/_template/gatling_logs -d '
{
"template": "gatling-*",
"settings": {
"number_of_shards": 1,
"number_of_replicas": 1
},
"mappings": {
input {
file {
type => "gatling"
path => "/path/to/output.log"
start_position => "beginning"
}
}
filter {
if ([message] =~ "\bRUN\b" or [message] =~ "\bSTART\b" or [message] =~ "\bEND\b" or [message] =~ "\bGROUP\b") {
val client = MongoClients.create(new ConnectionString("localhost:27017"))
val db = client.getDatabase("myDb")
val collection = db.getCollection("myCollection")
def findAndModify(filter: Document, update: Document, options: FindOneAndUpdateOptions): Future[Document] = {
val p: Promise[Document] = Promise()
collection.findOneAndUpdate(
filter, update, options,
new SingleResultCallback[Document] {
package com.ticketfly.promotersuite.authentication
import com.ticketfly.gatling.setup.HttpProtocol
import io.gatling.core.Predef._
import io.gatling.http.Predef._
class OAuth extends Simulation with HttpProtocol {
val scn =
require "rails_helper"
RSpec.describe "Students routes" do
describe "GET /students" do
it "routes to #index" do
expect(:get => "http://api.skillscourt.dev/v1/students").to route_to(
:format => "json", :action => "index", :controller => "api/v1/students")
end
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@duketon
duketon / XLWriter
Last active October 19, 2016 16:56
A Python script that uses the xlrd and openpyxl frameworks to read user defined cells from a selected Excel spreadsheet and append them to a seperate master workbook.
import shutil
import os
import xlrd
from xlrd import open_workbook
from openpyxl import load_workbook
import openpyxl
import glob
import datetime