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
glob:.hgignore | |
glob:.htaccess | |
glob:.htpasswd | |
glob:wp-config.php | |
glob:wp-content/uploads/* |
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
function elementInViewport(el) { | |
var rect = el.getBoundingClientRect() | |
return rect.top < (window.innerHeight || document.body.clientHeight) && rect.left < (window.innerWidth || document.body.clientWidth); | |
} | |
// and then you can use it: | |
alert(elementInViewport(document.getElementById('inner'))); | |
// or | |
alert(elementInViewport($('#inner')[0])); | |
` |
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
UPDATE data_table t, (SELECT DISTINCT ID, NAME, VALUE | |
FROM data_table | |
WHERE VALUE IS NOT NULL AND VALUE != '') t1 | |
SET t.VALUE = t1.VALUE | |
WHERE t.ID = t1.ID | |
AND t.NAME = t1.NAME |
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
-- Replace %s with table prefix | |
DELETE tr | |
FROM %s_term_relationships tr | |
INNER JOIN %s_term_taxonomy tt | |
ON (tr.term_taxonomy_id = tt.term_taxonomy_id) | |
WHERE tt.taxonomy != 'link_category' | |
AND tr.object_id NOT IN (SELECT ID FROM %s_posts); |
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
SELECT <field_name>, COUNT(*) c FROM <table> GROUP BY <field_name> HAVING c > 1; |
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
<?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"/> |
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
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 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 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 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/. | |
--> |
OlderNewer