Skip to content

Instantly share code, notes, and snippets.

@brasofilo
brasofilo / embedded-file-viewer.md
Created November 14, 2018 10:30 — forked from tzmartin/embedded-file-viewer.md
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@brasofilo
brasofilo / github.php
Last active November 5, 2023 23:40
GitHub Plug-in for WordPress (Take 2) * Basic information about your repositories and its Forks and Watchers. * Based on http://www.developerdrive.com/2013/06/github-plug-in-for-wordpress/
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: GitHub Plug-in for WordPress (Take 2)
* Description: Basic information about, your repositories, and its Forks and Watchers.
* Plugin URI: https://gist.github.com/brasofilo/6898766
* Version: 2013.10.09
* Author: Rodolfo Buaiz
* Author URI: http://brasofilo.com
* License: GPL
* Text Domain: plugin_unique_name
@brasofilo
brasofilo / wpse_70758.php
Created November 19, 2012 14:08
WordPress plugin : Prevent Categories Deletion
<?php
/*
Plugin Name: Prevent Category Deletion
Plugin URI: http://wordpress.stackexchange.com/q/70758/12615
Description: Prevent deletion of categories. Modify the $undeletable array to suit your setup. Use Category SLUGS.
Author: brasofilo
Version: 1.0
Author URI: http://wordpress.stackexchange.com/users/12615/brasofilo
*/
# Code from https://python.plainenglish.io/telegram-channel-listener-with-python-8176ebe3c89b
import configparser
import json
import re
from telethon.errors import SessionPasswordNeededError
from telethon import TelegramClient, events, sync
from telethon.tl.functions.messages import (GetHistoryRequest)
from telethon.tl.types import (
PeerChannel
@brasofilo
brasofilo / wp-admin-pointers.php
Last active September 3, 2023 20:25
WordPress Admin Pointers : based on code by Stephen Harris, Tim D and Frank Bueltge. See: http://stackoverflow.com/a/19328125/1287812 and http://brasofilo.com/como-incluir-admin-pointers-en-tu-theme-o-plugin
<?php
/**
* Plugin Name: My Amdin Pointers
* Plugin URI: https://gist.github.com/brasofilo/6947539
* Version: 0.1
* Author: Rodolfo Buaiz
* Author URI: http://brasofilo.com
* Licence: GPLv3
*
@brasofilo
brasofilo / install.php
Last active September 3, 2023 20:24
WP Install Defaults - Dropin Plugin
<?php
!defined( 'ABSPATH' ) AND exit;
/*
Plugin Name: Custom Installation Script
Plugin URI: http://wordpress.stackexchange.com/q/75420/12615
Description: Create our own content on WP install
License: GPL
*/
@brasofilo
brasofilo / code-snippets-shotcode.php
Last active August 26, 2023 23:48
Snippets Shortcode plugin. Add code snippets as a Custom Post Type. Display in regular posts and pages using a Shortcode. Rendered with Google Prettify in frontend.
<?php
/**
* Plugin Name: Snippets Shortcode
* Plugin URI: http://wordpress.stackexchange.com/q/116044/12615
* Description: Add code snippets as a Custom Post Type. Display in regular posts and pages using a Shortcode. Rendered with Google Prettify in frontend.
* Version: 1.0
* Author: Rodolfo Buaiz
* Author URI: http://brasofilo.com
* License: GPLv2 or later
*
<?php
/**
* Plugin Name: Move Accessibility plugins into a single menu
* Plugin URI: https://gist.github.com/brasofilo/4a8c1910a51bf4a06f7cd3e6087abe12
* Gist Plugin URI: brasofilo/4a8c1910a51bf4a06f7cd3e6087abe12
* Gist Plugin URI: https://gist.github.com/brasofilo/4a8c1910a51bf4a06f7cd3e6087abe12
* Description: Moves these 3 plugins: Accessibility Checker, One Click Accessibility, WP Accessibility
* Version: 2023-04-15
* Author: brasofilo
* Author URI: http://wordpress.stackexchange.com/users/12615
<?php
/**
* Plugin Name: Move Snippet
* Plugin URI: http://wordpress.stackexchange.com/questions/57211
* Description: Uses a custom template in the plugin directory accordding to Conditional Tags (http://codex.wordpress.org/Conditional_Tags), maybe even other conditions
* Version: 2023-03-15
* Author: brasofilo
* Author URI: http://wordpress.stackexchange.com/users/12615
* Gist Plugin URI: brasofilo/141df41cb1aff0a0dd9bf4036ff6df01
* Gist Plugin URI: https://gist.github.com/brasofilo/141df41cb1aff0a0dd9bf4036ff6df01
@brasofilo
brasofilo / inject.html
Last active March 30, 2023 02:15
Dolphin's Trigonometry :: WordPress Login Form :: adapted by brasofilo, original code by https://codepen.io/bleepbloop/pen/dyybMq
<div class='container'>
<div class='subcontainer'>
<div class='half'>
<div class='droplet'></div>
<div class='splash'>
<div class='splash-container'>
<div class='circle'></div>
</div>
</div>
</div>