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
--- | |
# This orchestration will perform a backup of a Tower machine and pull the | |
# backup files down to a bastion server for use with a later restore. | |
# | |
# http://docs.ansible.com/ansible-tower/latest/html/installandreference/upgrade_tower.html | |
# https://support.ansible.com/hc/en-us/articles/203295497-Tower-Manual-Backup-Restore | |
- name: Pull Ansible Tower backup | |
hosts: tower |
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 putin(_o); puts "You dont put Putin.\nPutin puts you..."; nil; end |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
require 'yaml' | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
# Load mappings.yml | |
MAPPINGS = YAML.load_file('mappings.yml') |
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
source 'http://rubygems.org' | |
gem 'grape' |
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
export PATH="./bin:$PATH" | |
bundle install --path=.gems --binstubs=.bin |
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
// Detect m3u support | |
// | |
// Mime type found here: | |
// http://developer.apple.com/library/ios/documentation/networkinginternet/conceptual/streamingmediaguide/DeployingHTTPLiveStreaming/DeployingHTTPLiveStreaming.html | |
// | |
var testEl = document.createElement('audio'), supported | |
supported = testEl.canPlayType('audio/x-mpegurl') != "" |
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 Mario | |
def initialize data_hash | |
@data_hash = data_hash | |
end | |
def cache_key | |
Digest::MD5.hexdigest @data_hash.to_s | |
end | |
end |
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
### Problem, rigid dependency injection ### | |
class Demo | |
def initialize | |
@instancev = Something.new | |
end | |
def method_1 | |
do_that | |
@instancev.something | |
end |
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
@foo.attributes = params[:foo] | |
if @foo.changed? | |
@foo.changes.each do |change| | |
# do something with the current_user | |
end | |
end | |
@foo.save |
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 foo | |
Foo.new do |f| | |
f.thing &bar | |
end | |
end | |
def bar | |
proc do |thing| | |
thing.title = "woop" | |
thing.time = Time.now |
NewerOlder