Skip to content

Instantly share code, notes, and snippets.

View whyisjake's full-sized avatar
✈️

Jake Spurlock whyisjake

✈️
View GitHub Profile
@mjangda
mjangda / wpcom-open-graph.php
Created September 5, 2011 22:30
Add Open Graph tags to your WordPress site
<?php
/**
* Open Graph Tags
*
* Add Open Graph tags so that Facebook (and any other service that supports them)
* can crawl the site better and we provide a better sharing experience.
*
* @link http://ogp.me/
* @link http://developers.facebook.com/docs/opengraph/
*/
@whyisjake
whyisjake / js_excerpt
Created October 22, 2011 04:00
Simple function to limit the length of an excerpt.
<?php
//To use, just call <?php js_excerpt(Charecters that you want); ?> in your theme. Add this bit here to your functions.php file.
function js_excerpt($length){
echo substr(get_the_excerpt(), 0, $length);
}
?>
@ninnypants
ninnypants / truncate_post
Created October 22, 2011 04:03 — forked from whyisjake/js_excerpt
Simple function to Change the length of an excerpt.
<?php
## Truncate Post
function custom_excerpt_length(){
global $excerpt_length;
return $excerpt_length;
}
function custom_excerpt_more(){
global $excerpt_more;
@ninnypants
ninnypants / jQuery with a PHP array...
Created October 27, 2011 04:20 — forked from whyisjake/jQuery with a PHP array...
Looking for an easy way to load a php array into some jQuery... Any ideas on how to simplify this?
<script>
post_ids = <?php echo json_encode(array(185,4,171)); ?>;
$(document).ready(function(){
/* Put your jQuery here */
$('.post-'+post_ids[1]).hide();
$('.post-'+post_ids[2]).hide();
$('.click'+post_ids[0]).addClass('active');
@alexkingorg
alexkingorg / query_format_standard.php
Created January 2, 2012 06:41
Enable WP_Query to search by "standard" post format.
<?php
function akv3_query_format_standard($query) {
if (isset($query->query_vars['post_format']) &&
$query->query_vars['post_format'] == 'post-format-standard') {
if (($post_formats = get_theme_support('post-formats')) &&
is_array($post_formats[0]) && count($post_formats[0])) {
$terms = array();
foreach ($post_formats[0] as $format) {
$terms[] = 'post-format-'.$format;
@eric1234
eric1234 / README.md
Last active December 11, 2015 22:08
S3 - Set permissions public on all files in a bucket using IronWorker.

Purpose

Workers to ensure all objects in a S3 bucket have the 'public-read' canned ACL permission. Designed to work with iron.io's IronWorker product to use it's scalable workers to set the permissions quickly and afforably.

Setup

@whyisjake
whyisjake / parts-grabber.php
Created March 6, 2013 01:22
Having issues getting all of the parts data from the Make: Projects API. Should be getting the type, and quantity from the response. Not seeing it here.
<?php
/**
* Trying to grab the parts quantity and the type, but they are missing.
* Check this page: http://makeprojects.com/api/0.1/guide/56 and note the parts array.
*/
header('Content-Type: text/html; charset=utf-8');
$url = 'http://makeprojects.com/api/0.1/guide/56';
$contents = file_get_contents( $url );
//echo $contents;
<?php
$array_name[0] = 'Keith Pelczarski';
$array_name[1] = 'Heather Harding';
$array_bio[0] = 'keith bio';
$array_bio[1] = 'heather bio';
$array_photo[0] = 'url/to/imag.jpg';
@aembleton
aembleton / docx2md.md
Last active May 17, 2023 07:04 — forked from vdavez/docx2md.md
Convert a Word Document into MD

Converting a Word Document to Markdown in One Move

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

Installing Pandoc

On a mac you can use homebrew by running the command brew install pandoc.

The Solution