Skip to content

Instantly share code, notes, and snippets.

@tomslominski
tomslominski / gist:3025101
Created June 30, 2012 18:57
I've managed to make the twenty-eleven comment bubble entirely CSS3, using this tutorial: http://www.sitepoint.com/pure-css3-speech-bubbles I'm sure the colours aren't right as I'm using it for my own design, but the bubble's there for you to use :)
p.comment-count {
position: relative;
width: 43px;
height: 30px;
text-align: center;
line-height: 30px;
background-color: #fff;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
// Translations stuff
yourls_add_action( 'plugins_loaded', 'isq_load_textdomain' ); // Trigger when all plugins are loaded
function isq_load_textdomain() {
yourls_load_custom_textdomain( 'isq_translation', dirname( __FILE__ ) . '/public/languages' );
}
// Translations stuff
function isq_load_textdomain() {
yourls_load_custom_textdomain( 'isq_translation', dirname( __FILE__ ) . '/public/languages' );
echo "This function has loaded";
}
isq_load_textdomain();
@tomslominski
tomslominski / bookmarklet-custom-popup.js
Last active December 29, 2015 06:58 — forked from ozh/gist:5495656
Bookmarklet JavaScript from YOURLS
javascript: (function () {
var d = document,
k = prompt('Custom URL'),
s = d.createElement('script');
if (k != null) {
window.yourls_callback = function (r) {
if (r.short_url) {
prompt(r.message, r.short_url);
} else {
alert('An error occured: ' + r.message);
@tomslominski
tomslominski / custom-shorten.js
Last active December 29, 2015 06:59 — forked from ozh/gist:5495656
Bookmarklet JavaScript from YOURLS: Infinity Squared edition
javascript: (function () {
var d = document,
w = window,
enc = encodeURIComponent,
e = w.getSelection,
k = d.getSelection,
x = d.selection,
s = (e ? e() : (k) ? k() : (x ? x.createRange().text : 0)),
s2 = ((s.toString() == '') ? s : enc(s)),
f = '<?php echo YOURLS_SITE . ' / result.php '; ?>',
@tomslominski
tomslominski / functions.php
Created April 8, 2015 17:42
Changing the intents in the DevBuddy Twitter plugin
/*
Changing intents in Twitter plugin
*/
if ( class_exists( 'DB_Twitter_Feed' ) ) {
function siteName_twitter_template_tag( $feed_config = NULL ) {
// Configuration validity checks are performed on instantiation
$the_feed = new DB_Twitter_Feed( $feed_config );
$url_data = array(
'tw' => $the_feed->tw,
@tomslominski
tomslominski / PHP error log.app
Last active December 14, 2015 12:20
Automator script to open the MAMP PHP error log in nearest terminal window - save as Automator application, export to your Applications folder
on run {input, parameters}
tell application "Terminal"
activate
if (count windows) is 0 then
do script with command "tail -f /Applications/MAMP/logs/php_error.log"
else
repeat with win in windows
try
@tomslominski
tomslominski / avahi-alias.sh
Last active July 6, 2024 07:32
Avahi alias systemd service. The first file is the script to be run, which you can store in your home directory. The second file is the systemd unit file which goes in /etc/systemd/system. Make sure on line 6 it references the location of the first file, and that you run systemctl daemon-reload after editing the unit file.
#!/bin/bash
local=$(avahi-resolve -4 -n $(hostname).local | cut -f 2)
hostname=$1
if [ $local != "127.0.0.1" ]
then
echo "Aliasing $local as $hostname."
avahi-publish -a -R $hostname $local
else
@tomslominski
tomslominski / functions.php
Created November 13, 2023 19:33
Custom Elementor condition
<?php
add_action( 'elementor/theme/register_conditions', function( \ElementorPro\Modules\ThemeBuilder\Classes\Conditions_Manager $manager ) {
require get_theme_file_path( 'gutenberg-page-condition.php' );
$manager->get_condition( 'singular' )->register_sub_condition( new Gutenberg_Page() );
} );