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
// | |
// AppDelegate+Calabash.m | |
// | |
// Only loaded for calabash target (where preprocesser has CALABASH=1) | |
#import "AppDelegate+Calabash.h" | |
@implementation AppDelegate (Calabash) | |
- (NSString *)calabashBackdoor:(NSString *)command { |
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
IFS=$'\n' | |
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}") | |
versionNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${PROJECT_DIR}/${INFOPLIST_FILE}") | |
PATH=${PATH}:/usr/local/bin | |
function checkFileExists () { | |
if [[ ! -e "$1" ]]; then | |
echo "Required file unable to be found: $1" | |
exit 1 | |
fi |
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
class people::thing_with_buildbox { | |
$library_dir = "${home}/Library" | |
$launch_dir = "${library_dir}/LaunchAgents" | |
$plist_location = "${launch_dir}/io.buildbox.buildbox-agent.plist" | |
$buildbox_token = "YOUR_TOKEN" | |
$buildbox_install_dir = "${home}/.buildbox" | |
$buildbox_log_dir = "${buildbox_install_dir}/log" | |
$buildbox_bin_dir = "${buildbox_install_dir}/bin" | |
$plist_template_url = "https://github.com/buildbox/agent/blob/master/templates/launchd_local_with_gui.plist" | |
$agent_name = "canary" |
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 | |
set -e | |
echo '--- autostarting buildkite agent' | |
your-install-location/bin/buildbox-agent \ | |
--token 'your-agent-access-token' \ | |
--name 'your-agent-name' \ | |
your-agent-additional-args |
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 python | |
# Test run with parallel | |
import os | |
import platform | |
import json | |
import argparse | |
import re | |
import subprocess | |
import sys |
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
require 'active_support/core_ext/kernel/reporting' | |
require 'monitor' | |
# Monkey patch silence_stream to be thread safe | |
# -> Pull request on Rails: https://github.com/rails/rails/pull/13139 | |
# -> But this will allow us to continue to see log output when running specs | |
# -> It could be we just patch ActiveRecord::SessionStore that triggers the `.quietly` calls | |
# on logging the `find_session_id` calls. | |
module Kernel | |
# Silences any stream for the duration of the block. |
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
require 'spec_helper' | |
describe 'deadlocks' do | |
describe "on login" do | |
it 'should allow multiple requests to login at same time' do | |
# Check original is ok | |
::Customer.find_by(id: customer_id).should be_blank | |
forks = [] |
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
#!/bin/sh | |
# /share/MD0_DATA/.qpkg/autorun/autorun-plexconnect.sh | |
# chmod +x /share/MD0_DATA/.qpkg/autorun/autorun-plexconnect.sh | |
curl -L https://gist.github.com/tommeier/6255771/raw/update_plex_connect.sh | bash & |
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
# Improve / Fix as many things in the code below | |
# Answers should be sent to hackademy@500tech.com | |
# Good luck | |
class User < ActiveRecord::Base | |
validates_presence_of :name, :email, :date_of_birth, :age_category | |
before_save do | |
age = (Time.now - date_of_birth).year | |
if age < 10 age_category = 'child' |
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
require 'rubygems' | |
require 'bundler' | |
Bundler.module_eval do | |
def self.append_gem(gem_name, options = {}) | |
return if gem_already_loaded?(gem_name, options[:version]) | |
version = options[:version] || '*' | |
spec_path = Dir.glob("#{Gem.dir}/specifications/#{gem_name}-#{version}.gemspec").last | |
if spec_path.nil? |
NewerOlder