This file contains hidden or 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
class CustomJsonFormatter(jsonlogger.JsonFormatter): | |
""" | |
Class that helps redefine the log message format | |
""" | |
def add_fields(self, log_record, record, message_dict): | |
super(CustomJsonFormatter, self).add_fields(log_record, record, message_dict) | |
if not log_record.get('timestamp'): | |
# this doesn't use record.created, so it is slightly off | |
now = datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S.%fZ') | |
log_record['timestamp'] = now |
This file contains hidden or 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
for X in $(say -v ? | cut -d' ' -f1); do echo $X && say -v "$X" "Welcome Professor"; done |
This file contains hidden or 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
- name: Get the databag data for this site/env | |
local_action: command knife data bag show nmdhosting {{ item.path | basename }} -F yaml | |
register: bag | |
when: current_directory.stat.exists is defined and current_directory.stat.exists | |
- name: Get that data into a YAML file | |
local_action: copy content="{{ bag.stdout }}" dest="/tmp/{{ item.path | basename }}_generated.yml" | |
when: current_directory.stat.exists is defined and current_directory.stat.exists | |
- name: Get those vars |
This file contains hidden or 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
<?php | |
// YOUR LOGIN INFO HERE: | |
$email = ''; | |
$password = ''; | |
// RUNNING IT FOR A PANTHEON ONE "ORGANIZATION": UNCOMMENT AND ADD YOUR UUID HERE | |
// $organiztion_uuid = 'some-org-uuid-here'; | |
// helper function | |
function terminus_json($command) { |
This file contains hidden or 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
/** | |
* Sets an iFrame ID to no_name_iframe if there is no ID. You can then add a Switch to iFrame step after it using the na_name_iframe ID. | |
* | |
* @Given /^I the set the iframe located in element with an id of "([^"]*)"$/ | |
*/ | |
public function iSetTheIframeLocatedInElementWithAnIdOf($element_id) { | |
$element = $this->getMainContext()->getSession()->getPage()->findById($element_id); | |
if ($element == NULL) { | |
throw new \Exception(sprintf("Element with ID '%s' not found", $element_id)); |
This file contains hidden or 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
#!/bin/bash | |
# Just in case something goes wrong, let's do this un-submodulifying on a new branch. | |
git checkout new_branch | |
# You need to go in and remove the SUBMODULE_DIR project from your .gitmodules file | |
# Save the URL that the submodule points to. | |
vim .gitmodules | |
# We're going to completely wipe out the SUBMODULE_DIR from your project...trust me... |
This file contains hidden or 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
<?php | |
// What is the drush command you wish to run? | |
// Some people just might use `php /usr/bin/drush/drush.php`, but I wanted to specify further options explicitely. | |
$drush='/Applications/MAMP/bin/php/php5.4.4/bin/php -d memory_limit=128M /drush/drush.php --php="/Applications/MAMP/bin/php/php5.4.4/bin -d memory_limit=128M"'; | |
// Where is the module directory you are trying to update? | |
$folders = scandir('/data/releases/homepage/dev/profiles/cu_homepage/modules/contrib'); | |
// Get rid of . and .. | |
unset($folders[0]); |
This file contains hidden or 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/perl -w | |
use strict; | |
use LWP::Simple; | |
use XML::RSS; | |
my @files = qw(defcon-10-video.rss | |
defcon-11-video.rss | |
defcon-12-video.rss | |
defcon-13-video.rss |
This file contains hidden or 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
#!/bin/bash | |
#Change these to tailor git to you | |
USER_NAME="Chris Sterling" | |
USER_EMAIL="[email protected]" | |
LOG_MESSAGES_EDITOR="vim" | |
DIFF_PROGRAM="meld" | |
echo "Configure GIT" | |
echo "" | |
echo "What user name would you like to use? ex) John Doe" |
This file contains hidden or 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
#!/bin/bash | |
#What is the name of your repo? This will serve as the folder name. | |
REPO_NAME="my-repo" | |
# Do NOT point to the trunk | |
URL_OF_REPO="https://myserver.example.com/svn/roommate-agreement" | |
# This is probably just "trunk" | |
TRUNK_LOCATION="trunk" | |
BRANCH_LOCATION="branches" |