Skip to content

Instantly share code, notes, and snippets.

---
model: "anthropic:claude-sonnet-4-20250514"
mcp_servers:
firecrawl:
command: "npx"
args: ["-y", "firecrawl-mcp"]
requiredEnvVars:
- FIRECRAWL_API_KEY
slack:
command: "npx"
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="">
<script src="/cdn-cgi/apps/head/rI_6LKuaFXg6F-4OLwmmNmyMGv8.js"></script><script src="https://ajax.cloudflare.com/cdn-cgi/scripts/7089c43e/cloudflare-static/rocket-loader.min.js" data-cf-settings="309cdbb7a64b216a53e8e14f-|49"></script><style id="ao_optimized_gfonts" media="print" onload="this.onload=null;this.media='all';">/* cyrillic-ext */
Convert quote_list articles (total 16) to v2? [y/n] y
Post #614121 is converted to v2
Post #548748 is converted to v2
Post #529076 is converted to v2
Post #529034 is converted to v2
Post #524605 is converted to v2
Post #524580 is converted to v2
Post #524556 is converted to v2
Post #493585 is converted to v2
Post #215563 is converted to v2
@leonho
leonho / rss.xml
Last active February 1, 2018 07:53
RSS testing
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
>
<channel>

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

<?php
/**
* Outputs the URL of the "Featured Image", also known as "Post Thumbnail".
* @param $post_id (optional) The ID of the Post whose Thumbnail you wish to output. When used within "The Loop", this parameter can be ommitted.
* @return void
*/
function the_post_thumbnail_url($post_id = false) {
global $post;
@leonho
leonho / composer.json
Created May 7, 2013 12:39
Example of working composer.json
{
"repositories": [
{
"type": "package",
"package": {
"name": "stepcase/wp-help",
"type": "wordpress-plugin",
"version": "1.2",
"source": {
"url": "https://github.com/stepcase/wp-help.git",
<?php
/*
Usage:
$frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL
if ( !$frag->output() ) { // NOTE, testing for a return of false
functions_that_do_stuff_live();
these_should_echo();
// IMPORTANT
$frag->store();
// YOU CANNOT FORGET THIS. If you do, the site will break.
@leonho
leonho / convert-tables-to-InnoDB.php
Created February 9, 2013 16:36
Convert existing Wordpress table to InnoDB
<?php
// connect your database here first
//
// Actual code starts here
$sql = "SHOW tables";
$rs = mysql_query($sql);
while($row = mysql_fetch_array($rs))