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
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited | |
# | |
# Current known FCC address ranges: | |
# https://news.ycombinator.com/item?id=7716915 | |
# | |
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft | |
# | |
# In your nginx.conf: | |
location / { |
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
/*! | |
* jquery.addrule.js 0.0.2 - https://gist.github.com/yckart/5563717/ | |
* Add css-rules to an existing stylesheet. | |
* | |
* @see http://stackoverflow.com/a/16507264/1250044 | |
* | |
* Copyright (c) 2013 Yannick Albert (http://yckart.com) | |
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php). | |
* 2013/11/23 | |
**/ |
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 float2rat(x) { | |
var tolerance = 1.0E-6; | |
var h1=1; var h2=0; | |
var k1=0; var k2=1; | |
var b = x; | |
do { | |
var a = Math.floor(b); | |
var aux = h1; h1 = a*h1+h2; h2 = aux; | |
aux = k1; k1 = a*k1+k2; k2 = aux; | |
b = 1/(b-a); |
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 get_attachment_id_from_src ($src) { | |
global $wpdb; | |
$reg = "/-[0-9]+x[0-9]+?.(jpg|jpeg|png|gif)$/i"; | |
$src1 = preg_replace($reg,'',$src); | |
if($src1 != $src){ | |
$ext = pathinfo($src, PATHINFO_EXTENSION); | |
$src = $src1 . '.' .$ext; | |
} | |
$query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$src'"; | |
$id = $wpdb->get_var($query); |