This file contains 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
def self.prevent_duplicates(objects_to_be_added, existing_vehicle_positions) | |
# Pass in a list of objects from which VehiclePositions will be created, and compare them to a list of existing VehiclePosition records. | |
# Return only the objects which would not be duplicates. | |
# Additionally, if duplicates are found within the existing VehiclePositions, delete them. | |
start_time = Time.current | |
logger.info "VehiclePosition prevent_duplicates starting..." | |
# Coming in, we have an array of hashes and an ActiveRecord::Relation. | |
# Combine both lists into one array of hashes, with the existing departures first. |
This file contains 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
import React from 'react'; | |
import styled from 'styled-components' | |
import MyHorizonalScrollingComponent from './MyHorizontalScrollingComponent' | |
const StyledDiv = styled.div` | |
overflow-x: scroll; | |
overflow-y: visible; | |
` | |
class MyHorizonalScrollingComponent extends React.Component { |
This file contains 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
import { SET_LOADER, CLEAR_LOADER } from '../actions/ui' | |
// Sets are a great way to track API requests for several different kinds of data. | |
// See my post about this at http://bit.ly/2Taqu5D | |
const uiState = { | |
loading: false, | |
features: new Set(), | |
} |
This file contains 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
// match 5 or more digit characters | |
export const extractRMNum = (taskTitle) => { | |
const result = taskTitle.match(/\d{5,}/); | |
if (result) return result[0]; | |
return null; | |
} | |
// match https://github.com/{orgName}/{repoNameWithZeroOrOneHyphen}/pull/{1 or more digit chars} | |
export const extractGithubPrUrl = (taskNotes) => { | |
const result = taskNotes.match(/https:\/\/github\.com\/\w+\/\w+-*\w*\/pull\/\d+/); |
This file contains 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
// Zapier task: "Add RM # to Asana task from PR title" | |
// This is the exact code used in the Zapier step. | |
const { taskTitle, taskNotes} = inputData; | |
// match 5 or more digit characters | |
const extractRMNum = (taskTitle) => { | |
const result = taskTitle.match(/\d{5,}/); | |
if (result) return result[0]; | |
return null; |
This file contains 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
// Zap: Foreman - New RM issue from Asana magic tag | |
// Step 3: Check Asana tags for RM Tracker type | |
const { tags, assignee } = inputData; | |
let tagList = []; | |
if (tags) tagList = tags.split(","); | |
const tagNameToRM = { | |
bug: 1, | |
feature: 2, | |
refactor: 4, |
This file contains 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
#!/usr/bin/env bash | |
# Get the IP address of a Vagrant box using vagrant ssh-config, then connect to it using sshfs. | |
cd /home/jeremylenz/code/forklift | |
VAGRANT_BOX=$1 | |
if [ -z $VAGRANT_BOX ] # if no command-line arg provided, use stable box | |
then | |
VAGRANT_BOX="centos7-katello-devel-stable" | |
fi | |
echo VAGRANT_BOX: $VAGRANT_BOX |
This file contains 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
#!/usr/bin/env bash | |
sudo service rh-mongodb34-mongod restart | |
sudo service pulp_workers restart | |
sudo service pulp_celerybeat restart | |
sudo service pulp_resource_manager restart |
This file contains 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
#!/usr/bin/env bash | |
sudo service tomcat restart |
This file contains 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
# Add to your ~/.bashrc, then run source ~/.bashrc | |
# virsh-snapshot-create mybox mysnap | |
# Run in forklift directory | |
function virsh-snapshot-create { | |
vagrant halt $1 | |
virsh snapshot-create-as forklift_$1 $2 | |
vagrant up $1 | |
} |
OlderNewer