This file contains hidden or 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
# Set the REQUIRE_AUTH environment variable if we should password protect | |
SetEnv NO_AUTH 1 | |
SetEnvIfNoCase HOST staging !NO_AUTH | |
SetEnvIfNoCase Request_URI ^/privacy-policy$ NO_AUTH | |
RewriteRule ^ https://www.google.com$%{ENV:NO_AUTH} [L,R=302] | |
# Define the basic auth setup | |
AuthType Basic | |
AuthName "Staging Area" | |
AuthUserFile /var/app/current/public/.htpasswd |
This file contains hidden or 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
# These two statements will correctly set REQUIRE_AUTH to 1 or nothing | |
SetEnvIfNoCase HOST staging REQUIRE_AUTH | |
SetEnvIfNoCase Request_URI ^/privacy-policy$ !REQUIRE_AUTH | |
AuthType Basic | |
AuthName "Staging Area" | |
AuthUserFile /var/app/current/public/.htpasswd | |
Require valid-user | |
Order Allow,Deny |
This file contains hidden or 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
AuthType Basic | |
AuthName "Staging Area" | |
AuthUserFile /var/app/current/public/.htpasswd | |
Require valid-user | |
SetEnvIfNoCase HOST staging REQUIRE_AUTH | |
SetEnvIfNoCase Request_URI ^/privacy-policy$ !REQUIRE_AUTH | |
Order Allow,Deny | |
Allow from All | |
Deny from env=REQUIRE_AUTH |
This file contains hidden or 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 "(%{HTTP_HOST} =~ /staging/) && ! (%{REQUEST_URI} =~ /privacy-policy$/)"> | |
AuthType Basic | |
AuthName "Staging Area" | |
AuthUserFile /var/app/current/public/.htpasswd | |
Require valid-user | |
</If> |
This file contains hidden or 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
'use strict'; | |
module.exports = (event, context, callback) => { | |
console.log("Send the response: " + event.params.querystring.challenge); | |
callback(null, { challenge: event.params.querystring.challenge }); | |
}; |
This file contains hidden or 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 interval = null; | |
var onStart = function(context) { | |
[coscript setShouldKeepAround:true]; | |
interval = [coscript scheduleWithInterval:1.0 jsFunction:function() { | |
log("In interval"); | |
}]; | |
}; |
This file contains hidden or 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
ex6.54.cpp:12:11: error: unexpected type name 'func': expected expression | |
vector<*func> funcPtrs; | |
^ | |
1 error generated. |
This file contains hidden or 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 ApiController < ApplicationController | |
def index | |
# request.headers always equals {} | |
if request.headers['Authorization'] == 'HELLO' | |
render text: 'SUCCESS', status: :ok | |
else | |
render text: 'FAILURE', status: :unauthorized | |
end |
This file contains hidden or 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
curl -X GET 'http://elasticsearch.local/listings/_search?pretty' -d ' | |
{ | |
"from": 0, | |
"size": 20000, | |
"query": { | |
"bool": { | |
"must": [ | |
{"term": {"state":{"term":"active"}}}, | |
{"term": {"account_type":{"term":"free"}}}, |
This file contains hidden or 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 DashboardObserver < ActiveRecord::Observer | |
observe :user | |
def after_activate(user) | |
DashboardService.update_metrics | |
end | |
end |
NewerOlder