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
array = [ | |
1, | |
2, | |
[3, 4, 5, [6, 7, 8]], | |
[9, 10, 11, 12], | |
13 | |
] | |
@capture = [] |
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
module FeatureHelpers | |
def ng_visit(state_name, route_params={}, options={}) | |
js_route_params = route_params.to_json | |
js_route_opts = { | |
reload: true | |
}.merge(options).to_json | |
inactive = (page.evaluate_script("typeof(angular)") == 'undefined') |
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
if (EPURA_ENVIRONMENT === 'test'){ | |
angular.module('warehouse').factory('cacheBustInterceptor', function() { | |
return { | |
request: function(config) { | |
if (config.method === 'GET' && config.url.indexOf('/api/') > -1) { | |
if (config.params === undefined) { | |
config.params = {}; | |
} | |
config.params.bust = Math.random().toString(36).replace(/[^a-z]+/g, ''); |
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
cd ~/Library/LaunchAgents/ | |
# plist goes in this directory | |
launchctl load com.aaron.whatever.plist | |
# Disable: | |
launchctl unload com.aaron.whatever.plist |
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 ruby | |
# | |
# List branches merged into integration but not master: branch-diff --yes integration --no master | |
# | |
# List commits present in integration but not master: branch-diff --commits --yes integration --no master | |
# | |
require 'optparse' | |
require 'ostruct' | |
class OptparseExample |
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
echo "Running RSpec" | |
bundle exec rake spec | |
spec=$? | |
if [ $spec -eq 0 ]; then | |
osascript -e 'display notification "Tests have passed, pushing" with title "EMT Specs"' | |
echo "\\033[32mTests are green, pushing...\\033[0;39m" | |
exit 0 | |
else | |
osascript -e 'display notification "Tests have failed, stopping push" with title "EMT Specs"' |
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
function bc(){ | |
var template = ['<ul class="breadcrumb">', | |
'<li>', | |
'<a ui-sref="dashboard">Dashboard</a>', | |
'</li>', | |
'<li ng-repeat="breadcrumb in breadcrumbs">', | |
'<a href="#{{ breadcrumb.path }}">{{ breadcrumb.title }} </a>', | |
'</li>', | |
'</ul>'].join(''); | |
return { |
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
shooter.createSitemapModal = function () { | |
var cloneModalInstanceCtrl = $modal.open({ | |
templateUrl: path + 'sitemaps/templates/_modal_create_sitemap.html', | |
controller: 'CreateSitemapController as createSitemap' | |
}); | |
cloneModalInstanceCtrl.result.then(function (sitemap) { | |
shooter.createSitemap(sitemap); | |
}); | |
}; |
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
shooter.createSitemap = function (postableData) { | |
SitemapService.create({sid: siteId}, postableData, function (data) { | |
$state.go('site.viewSitemap', {sid: siteId, sitemapId: data.data.id}); | |
}, function (data) { //failure | |
//error handling goes here | |
Noty(data.data.message, 'error'); | |
}); | |
}; |