Git commands that I use enough that I decided to write them down.
#!/bin/bash | |
# cd into the directory | |
cd ~/gitsync/github-wordpress-sync/; | |
# Make sure we are not already running | |
if [ -f .sync-running ];then | |
if test ! `find ".sync-running" -mmin +10`;then | |
# Currently running, but not stuck | |
exit 1; | |
fi | |
fi; |
<?php | |
/** | |
* Turn email-style quotes into blockquotes | |
* | |
* For example: | |
* | |
* My friend said: | |
* | |
* > You are handsome and also |
<?php | |
/* | |
Plugin Name: Heartbeat Comment Update | |
Description: Updates Comment Count on Dashboard with Heartbeat. | |
Author: Andrew Ozz, Mike Schroder | |
Version: 0.2 | |
Author URI: http://www.getsource.net | |
*/ | |
add_filter( 'heartbeat_received', 'wc_heartbeat_comment_count', 10, 3 ); |
<style> | |
.hexagon { | |
height: 150px; | |
overflow: hidden; | |
transform: rotate(120deg); | |
width: 300px; | |
-webkit-transform: rotate(120deg); | |
-moz-transform: rotate(120deg); | |
-o-transform: rotate(120deg); |
<?php | |
/** | |
* Make an internal REST request | |
* | |
* @global WP_REST_Server $wp_rest_server ResponseHandler instance (usually WP_REST_Server). | |
* @param $request_or_method WP_REST_Request|string A WP_REST_Request object or a request method | |
* @param $path (optional) if the path is not specific in the rest request, specify it here | |
* @param $data (optional) option data for the request. | |
* @return WP_Error|mixed |
/* | |
actually.js | |
_ _ _ | |
__ _ __ _ __ _ __ _ ___| |_ _ _ __ _| | |_ _ | |
/ _` |/ _` |/ _` |/ _` |/ __| __| | | |/ _` | | | | | | | |
| (_| | (_| | (_| | (_| | (__| |_| |_| | (_| | | | |_| |_ | |
\__,_|\__,_|\__,_|\__,_|\___|\__|\__,_|\__,_|_|_|\__, ( ) | |
|___/|/ | |
*/ |
var express = require('express'); | |
var expressWs = require('express-ws'); | |
var expressWs = expressWs(express()); | |
var app = expressWs.app; | |
app.use(express.static('public')); | |
var aWss = expressWs.getWss('/'); | |
app.ws('/', function(ws, req) { |
- 🎨 when improving the format/structure of the code
- 🚀 when improving performance
- ✏️ when writing docs
- 💡 new idea
- 🚧 work in progress
- ➕ when adding feature
- ➖ when removing feature
- 🔈 when adding logging
- 🔇 when reducing logging
- 🐛 when fixing a bug
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.