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
<?php | |
/* | |
Password logger for wordpress | |
*/ | |
function log_login_success($username) { | |
log_login_attempts($username, true); | |
} | |
function log_login_fail($username) { | |
log_login_attempts($username, 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
var fridayTime = function() { | |
var now = new Date(), | |
day = now.getDay(), | |
date = now.getDate(), | |
fridayDate = date + (5 - day), | |
friday = new Date(2016, now.getMonth(), fridayDate), | |
timeDiff = Math.abs(friday.getTime() - now.getTime()), | |
msToTime = function(s) { | |
var ms = s % 1000; | |
s = (s - ms) / 1000; |
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 g = 0; | |
var n = 10001; | |
var i = 1; | |
var isPrime = function(x) { | |
if( x < 2) return false; | |
if(x < 4) return true; | |
if( x % 3 == 0 || x % 2 == 0) return 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
import math | |
n = 2000000 | |
def primesTo(lim): | |
primes = [2] | |
t = 0 | |
sieve = [False] * lim | |
crosslim = int(math.sqrt(lim)) |
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
<?php | |
class Opened_Topics_Widget extends WP_Widget { | |
public function __construct() { | |
parent::__construct( | |
'widget_display_topics', // Base ID | |
__( 'Recent Topics', 'bbpress' ), // Name | |
array( 'description' => __( 'A list of recent topics, replied by customers.', 'bbpress' ), ) // Args | |
); | |
} |
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
<?php | |
/** | |
* Front to the WordPress application. This file doesn't do anything, but loads | |
* wp-blog-header.php which does and tells WordPress to load the theme. | |
* | |
* @package WordPress | |
*/ | |
/** | |
* Tells WordPress to load the WordPress theme and output it. |
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
public function wp_rewrite_rules() { | |
$this->rules = get_option('rewrite_rules'); | |
if ( empty($this->rules) ) { | |
$this->matches = 'matches'; | |
$this->rewrite_rules(); | |
if ( ! did_action( 'wp_loaded' ) ) { | |
add_action( 'wp_loaded', array( $this, 'flush_rules' ) ); | |
return $this->rules; | |
} |
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
// node_modules/gemini/lib/browser/new-browser.js | |
open(url, params) { | |
params = _.defaults(params || {}, { | |
resetZoom: false | |
}); | |
// console.log(this._currentUrl); | |
if( this._currentUrl == url ) { |
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
<!-- wp:group {"align":"full","layout":{"type":"constrained"}} --> | |
<div class="wp-block-group alignfull"><!-- wp:group {"align":"full","layout":{"type":"constrained"}} --> | |
<div class="wp-block-group alignfull"><!-- wp:group {"align":"full","layout":{"type":"constrained"}} --> | |
<div class="wp-block-group alignfull"><!-- wp:cover {"url":"https://cldup.com/Fz-ASbo2s3.jpg","dimRatio":50,"align":"wide"} --> | |
<div class="wp-block-cover alignwide"><span aria-hidden="true" class="wp-block-cover__background has-background-dim"></span><img class="wp-block-cover__image-background" alt="" src="https://cldup.com/Fz-ASbo2s3.jpg" data-object-fit="cover"/><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…","textColor":"white","fontSize":"large"} --> | |
<p class="has-text-align-center has-white-color has-text-color has-large-font-size">Of Mountains & Printing Presses</p> | |
<!-- /wp:paragraph --></div></div> | |
<!-- /wp:cover --> | |
<!-- wp:paragraph --> |