curl -XDELETE localhost:9200/*
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
var sendString = (function(rfb, force, sendDelay) { | |
sendDelay = sendDelay || 25; | |
var _q = []; | |
var _qStart = function() { | |
var chr = _q.shift(); | |
if (chr) { | |
rfb.sendKey(chr); | |
setTimeout(_qStart, sendDelay); | |
} | |
}; |
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
/** | |
* Fetches how many bytes have been downloaded so far and updates ProgressBar | |
*/ | |
class DownloadProgressCounter extends Thread { | |
private final long downloadId; | |
private final DownloadManager.Query query; | |
private Cursor cursor; | |
private int lastBytesDownloadedSoFar; | |
private int totalBytes; |
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
VCR.configure do |c| | |
c.cassette_library_dir = 'spec/fixtures/vcr_cassettes' | |
c.hook_into :webmock | |
c.ignore_localhost = true | |
c.default_cassette_options = { record: :new_episodes } | |
c.allow_http_connections_when_no_cassette = false | |
c.configure_rspec_metadata! | |
c.ignore_hosts 'codeclimate.com' |
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 API::V1::BaseController < ApplicationController | |
skip_before_filter :verify_authenticity_token | |
before_filter :cors_preflight_check | |
after_filter :cors_set_access_control_headers | |
def cors_set_access_control_headers | |
headers['Access-Control-Allow-Origin'] = '*' | |
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS' |
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
# Install Git needed for Git based gems | |
packages: | |
yum: | |
git: [] | |
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
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
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
# Thanks to http://makandracards.com/makandra/1431-resque-+-god-+-capistrano for an idea and v2 version. | |
namespace :god do | |
def god_is_running | |
capture(:bundle, "exec god status > /dev/null 2>&1 || echo 'god not running'") != 'god not running' | |
end | |
# Must be executed within SSHKit context | |
def config_file | |
"#{release_path}/config/god.rb" |
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
@media only screen and (min-width: 320px) { | |
/* Small screen, non-retina */ | |
} | |
@media | |
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px), | |
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px), | |
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px), |