https://gist.github.com/steakknife/b318a570803b08c1548c7f51c18c0753
Dual-licensed: MIT or DWFTYL
Listen
fires up afsevent_watch
for every directory watched
https://gist.github.com/steakknife/b318a570803b08c1548c7f51c18c0753
Dual-licensed: MIT or DWFTYL
Listen
fires up a fsevent_watch
for every directory watched# use SSHKit directly instead of Capistrano | |
require 'sshkit' | |
require 'sshkit/dsl' | |
include SSHKit::DSL | |
# set the identifier used to used to tag our Docker images | |
deploy_tag = ENV['DEPLOY_TAG'] | |
# set the name of the environment we are deploying to (e.g. staging, production, etc.) | |
deploy_env = ENV['DEPLOY_ENV'] || :production |
PLATFORMS := linux/amd64 windows/amd64 | |
temp = $(subst /, ,$@) | |
os = $(word 1, $(temp)) | |
arch = $(word 2, $(temp)) | |
release: $(PLATFORMS) | |
$(PLATFORMS): | |
GOOS=$(os) GOARCH=$(arch) go build -o '$(os)-$(arch)' mypackage |
The purpose of all this is to see if sphinx, thinking sphinx and thinking sphinx delayed delta are all working properly. | |
I created a test controller on a separate monit subdomain that simply generates and posts a test value and then uses curl to retrieve it. If the two values match, then sphinx is working properly with delayed delta. | |
This example assumes a Linux installation. | |
The file 'delayed_delta.sh' spawns the `rake ts:dd` process in the background, saving its PID to tmp/pids in your Rails project. You can start and stop it by running '/etc/init.d/delayed_delta.sh start' and '/etc/init.d/delayed_delta.sh stop'. You will use these in your monitoring to, see the monitrc snippet. | |
In a crontab, every X seconds or minutes, run 'ar_sphinx_mon.sh' to see if records are properly being inserted and indexed. If they aren't, then kill all Thinking Sphinx processes and monit should restart them. |
var map = L.map( 'map' ); | |
L.Map.prototype.panToOffset = function (latlng, offset, options) { | |
var x = this.latLngToContainerPoint(latlng).x - offset[0] | |
var y = this.latLngToContainerPoint(latlng).y - offset[1] | |
var point = this.containerPointToLatLng([x, y]) | |
return this.setView(point, this._zoom, { pan: options }) | |
} | |
function centerMap(){ |
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | |
<script type="text/javascript"> | |
"use strict"; | |
$(function(){ | |
var getTextNodesIn = function(el) { | |
return $(el).find(":not(iframe)").addBack().contents().filter(function() { | |
return this.nodeType == 3; |
describe 'my fake tests', :type => :feature do | |
it 'this scenario should pass' do | |
expect(true).to eq true | |
end | |
it 'this scenario should fail' do | |
expect(false).to eq true | |
end | |
end |
I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.
What I decided on was the following: put your secret information into a vars
file, reference that vars
file from your task
, and encrypt the whole vars
file using ansible-vault encrypt
.
Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.
var HTMLChanger = (function() { | |
var contents = 'contents' | |
var changeHTML = function() { | |
var element = document.getElementById('attribute-to-change'); | |
element.innerHTML = contents; | |
} | |
return { | |
callChangeHTML: function() { |