Skip to content

Instantly share code, notes, and snippets.

View ocean90's full-sized avatar
🌊
Surfing the open source wave

Dominik Schilling ocean90

🌊
Surfing the open source wave
View GitHub Profile
Extension: avi
wordpress => video/avi
apache => video/x-msvideo
Extension: divx
wordpress => video/divx
apache =>
Extension: m4v
wordpress => video/mp4
<?php
# for((i=100;i--;)); do php 21760.php; done
include __DIR__ . '/wp-load.php';
global $wpdb;
$memory = memory_get_usage();
$num_queries = $wpdb->num_queries;
$start = microtime( true );
get_term_by( 'slug', 'tag-117', 'post_tag' );
@ocean90
ocean90 / seo-monitor-googleplus.php
Created February 13, 2012 20:28
wpSEO Monitor um Google+ Einkreisungen ergänzen.
<?php
/*
* Plugin Name: wpSEO Monitor Addon: Google+ Kennzahl
* Plugin URI: https://plus.google.com/101675293278434581718/posts/2E88QNTcXjE
* Description: Ergänzt den wpSEO Monitor um Google+ Einkreisungen. In wpSEO 3.0.3 bereits fester Bestandteil des Plugin.
* Version: 0.3
* Author: Dominik Schilling
* Author URI: http://wpgrafie.de
* License: GPLv2
*
@ocean90
ocean90 / load-jquery-in-footer-php53.php
Created March 3, 2012 20:51
WordPress: Print jQuery in footer on front-end.
@ocean90
ocean90 / tree.txt
Created April 1, 2016 15:35
Tree of node_modules
.
├── JSONStream
│   ├── examples
│   └── test
│   ├── disabled
│   └── fixtures
├── abbrev
├── acorn
│   ├── bin
│   ├── dist
{
"themes": {
"generatepress": {
"theme": "generatepress",
"new_version": "1.3.28",
"url": "https://wordpress.org/themes/generatepress/",
"package": "https://downloads.wordpress.org/theme/generatepress.1.3.28.zip",
"translations": [
{
"type": "theme",
var oldThemesView = wp.themes.view.Themes;
wp.themes.view.Themes = oldThemesView.extend({
initialize: function() {
oldThemesView.prototype.initialize.apply( this, arguments );
this.stopListening( this.parent, 'theme:scroll' );
},
});
VM794:1 Uncaught SyntaxError: Unexpected token <
(anonymous function) @ jquery.js?ver=1.12.0:2
n.extend.globalEval @ jquery.js?ver=1.12.0:2
Ha @ jquery.js?ver=1.12.0:3
n.fn.extend.replaceWith @ jquery.js?ver=1.12.0:3
wp.customize.selectiveRefresh.self.Partial.api.Class.extend.renderContent @ customize-selective-refresh.js?ver=4.5-alpha-35776-src-1455797107:295
wp.customize.navMenusPreview.wp.customize.MenusCustomizerPreview.self.NavMenuInstancePartial.api.selectiveRefresh.Partial.extend.renderContent @ customize-preview-nav-menus.js?ver=4.5-alpha-35776-src-1455797107:118
(anonymous function) @ customize-selective-refresh.js?ver=4.5-alpha-35776-src-1455797107:225
_.each._.forEach @ underscore.js?ver=1.8.3:153
@ocean90
ocean90 / plugin.php
Created February 2, 2012 12:25
Remove gravatar from the WordPress Toolbar
<?php
/*
* Entfernt das Gravatar aus der Toolbar.
* @link: http://talkpress.de/artikel/wordpress-admin-bar-datenkrake-missbrauch
*/
/* < PHP 5.3 */
function ds_add_hide_avatar_filter() {
add_filter( 'pre_option_show_avatars', '__return_zero' );
}
<?php
$data = file_get_contents( 'https://raw.githubusercontent.com/unicode-cldr/cldr-core/master/supplemental/territoryInfo.json' );
$data = json_decode( $data );
$country2langs = [];
foreach ( $data->supplemental->territoryInfo as $country => $data ) {
if ( ! isset( $data->languagePopulation ) ) {
continue;