Skip to content

Instantly share code, notes, and snippets.

View AramZS's full-sized avatar
🎯
Focusing

Aram Zucker-Scharff AramZS

🎯
Focusing
View GitHub Profile
@boonebgorges
boonebgorges / gist:3430079
Created August 22, 2012 22:27 — forked from markjaquith/gist:2628225
Script to sync WordPress SVN to GitHub
#!/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;
@boonebgorges
boonebgorges / gist:3657745
Created September 6, 2012 15:54
WP filter to turn email-style quotes into blockquotes
<?php
/**
* Turn email-style quotes into blockquotes
*
* For example:
*
* My friend said:
*
* > You are handsome and also
@getsource
getsource / heartbeat-comments.php
Last active December 21, 2015 05:08
Heartbeat Sample plugin
<?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 );
@yurivictor
yurivictor / hexagon.html
Last active December 22, 2015 09:59
CSS Hexagon
<style>
.hexagon {
height: 150px;
overflow: hidden;
transform: rotate(120deg);
width: 300px;
-webkit-transform: rotate(120deg);
-moz-transform: rotate(120deg);
-o-transform: rotate(120deg);
@morganestes
morganestes / .git-commands.md
Last active June 17, 2016 18:48
Custom Git commands for bash

Git commands that I use enough that I decided to write them down.

<?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
@ftrain
ftrain / actually.js
Last active November 10, 2023 01:16
A program that generates actuallies
/*
actually.js
_ _ _
__ _ __ _ __ _ __ _ ___| |_ _ _ __ _| | |_ _
/ _` |/ _` |/ _` |/ _` |/ __| __| | | |/ _` | | | | | |
| (_| | (_| | (_| | (_| | (__| |_| |_| | (_| | | | |_| |_
\__,_|\__,_|\__,_|\__,_|\___|\__|\__,_|\__,_|_|_|\__, ( )
|___/|/
*/
@hugosp
hugosp / app.js
Created April 4, 2016 22:37
Minimal express-ws broadcast to all clients
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
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

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