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
#!/usr/bin/env python | |
numbers = [16, 17, 4, 3, 5, 2] | |
leaders = [] | |
for i, n in enumerate(numbers): | |
remaining = numbers[i+1:] | |
if len(remaining) == 0 or n > max(remaining): | |
leaders.append(n) |
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
// This action should be inside add_actions | |
/** | |
* Remove Gravityforms captcha action | |
* This is a fix to prevent interferences from commonLib.js | |
*/ | |
add_action('get_footer', function(){ | |
global $wp_filter; | |
foreach($wp_filter['wp_footer']->callbacks as $priority => $hooks){ | |
foreach($hooks as $k => $hook){ |
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
RewriteEngine On | |
RewriteBase / | |
RewriteRule .* - [E=INFO_API_VERSION:%{API_VERSION},NE] | |
RewriteRule .* - [E=INFO_AUTH_TYPE:%{AUTH_TYPE},NE] | |
RewriteRule .* - [E=INFO_CONTENT_LENGTH:%{CONTENT_LENGTH},NE] | |
RewriteRule .* - [E=INFO_CONTENT_TYPE:%{CONTENT_TYPE},NE] | |
RewriteRule .* - [E=INFO_DOCUMENT_ROOT:%{DOCUMENT_ROOT},NE] | |
RewriteRule .* - [E=INFO_GATEWAY_INTERFACE:%{GATEWAY_INTERFACE},NE] | |
RewriteRule .* - [E=INFO_HTTPS:%{HTTPS},NE] | |
RewriteRule .* - [E=INFO_HTTP_ACCEPT:%{HTTP_ACCEPT},NE] |
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
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir) | |
EB_APP_STAGING_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_staging_dir) | |
EB_APP_USER=$(/opt/elasticbeanstalk/bin/get-config container -k app_user) | |
EB_SUPPORT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k support_dir) |
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
{ | |
"name": "company/wp-unit-tests", | |
"type": "wordpress-plugin", | |
"require": { | |
"phpunit/phpunit": "~5.0.6" | |
}, | |
"autoload": { | |
"psr-4": {"company\\Tests\\": "src/"}, | |
"files": ["src/functions.php"] | |
} |
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
<!-- Start of Brightcove Player --> | |
<div style="display:none"> | |
</div> | |
<!-- | |
By use of this code snippet, I agree to the Brightcove Publisher T and C | |
found at https://accounts.brightcove.com/en/terms-and-conditions/. | |
--> |
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
#!/bin/bash | |
while read LINE; do | |
curl -o /dev/null --silent --head --write-out '%{http_code}' "$LINE" | |
echo " $LINE" | |
done < url-list.txt |
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
/** | |
* Convert longitude and latitude from standard WGS-84 system | |
* to Baidu's BD-09 | |
* | |
* @see http://stackoverflow.com/a/29512814/718811 for a detailed | |
* description of the problem. | |
* | |
* @param float lng Longitude | |
* @param float lat Latitude | |
* @return object Converted coords |
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
Valore * base^posizione da destra + Valore * base^posizione da destra .... | |
es. 0xAF | |
F * 16^0 + A * 16^1 | |
diventa | |
15 * 16^0 + 10 * 16^1 | |
diventa | |
15 + 160 |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<staticContent> | |
<mimeMap fileExtension=".json" mimeType="application/json"/> | |
<mimeMap fileExtension=".ejs" mimeType="application/javascript"/> | |
</staticContent> | |
<rewrite> | |
<rules> | |
<rule name="Imported Rule 1"><match url="^(.+)\.(.+)\.(js|css)$" ignoreCase="false"/> |
NewerOlder