Skip to content

Instantly share code, notes, and snippets.

View norcross's full-sized avatar
somone said this would be easy. someone LIED.

Norcross norcross

somone said this would be easy. someone LIED.
View GitHub Profile
@markjaquith
markjaquith / aaa.nginxconf
Last active February 1, 2017 04:30
Grab non-locally-existing production images from Photon for your local WordPress dev environment
location ~* \.(jpe?g|gif|png)$ {
try_files $uri @photon;
}
location @photon {
rewrite ^(.*)-([0-9]+)x([0-9]+)\.(jpe?g|gif|png)$ http://i0.wp.com/$host$1.$4?resize=$2,$3;
rewrite . http://i0.wp.com/$host$request_uri;
}
@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@trepmal
trepmal / gist:1c66dbe97e8f322bc107
Created December 19, 2014 22:42
wp-cli: reset all user passwords
#!/bin/bash
for uid in $(wp user list --field=ID)
do
pass=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32}`
wp user update $uid --user_pass="$pass"
done
array(
"AF" => "Afghanistan (‫افغانستان‬‎)",
"AX" => "Åland Islands (Åland)",
"AL" => "Albania (Shqipëri)",
"DZ" => "Algeria (‫الجزائر‬‎)",
"AS" => "American Samoa",
"AD" => "Andorra",
"AO" => "Angola",
"AI" => "Anguilla",
"AQ" => "Antarctica",
@trepmal
trepmal / !note.txt
Last active August 29, 2015 14:05
return-to-top arrow, à la wp.com
Needs some love. Styles in the footer, assumptions about jQuery, yadda yadda yadda...
@tatemz
tatemz / class-page-object.php
Created August 2, 2014 21:36
How to Optimize Your WordPress Metadata
<?php
class Page_Object {
public $ID;
public $original_post;
public $data = array();
public function __construct( $id ) {
@gregrickaby
gregrickaby / wordpress-sample-content.txt
Last active August 10, 2016 20:35
Sample content for QA purposes. Just copy/paste into a post or page and hit "publish". Also, here is an Alfred Workflow: http://gregslink.co/1FFTova
<h1>This is an H1</h1>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Tu vero, inquam, ducas licet, si sequetur; Haec et tu ita posuisti, et verba vestra sunt. Atque his de rebus et splendida est eorum et illustris oratio. Eam stabilem appellas. Nam Pyrrho, Aristo, Erillus iam diu abiecti. Illa sunt similia: hebes acies est cuipiam oculorum, corpore alius senescit; Est enim effectrix multarum et magnarum voluptatum. Duo Reges: constructio interrete.<!--more-->
Fortasse id optimum, sed ubi illud: Plus semper voluptatis? Nihil enim hoc differt. Hoc enim constituto in philosophia constituta sunt omnia. Dat enim intervalla et relaxat. Aliena dixit in physicis nec ea ipsa, quae tibi probarentur; Tecum optime, deinde etiam cum mediocri amico. Ait enim se, si uratur, Quam hoc suave! dicturum. Respondent extrema primis, media utrisque, omnia omnibus.
<h2>This is an H2</h2>
Ita multo sanguine profuso in laetitia et in victoria est mortuus. Quae duo sunt, unum facit. Expectoque quid ad id, quod quaerebam, re
@hdragomir
hdragomir / sm-annotated.html
Last active March 5, 2024 08:57
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@boonebgorges
boonebgorges / bbg-csv-export.php
Created May 13, 2014 18:13
WordPress script for doing a .csv export of misc data
<?php
function bbg_csv_export() {
if ( ! is_super_admin() ) {
return;
}
if ( ! isset( $_GET['bbg_export'] ) ) {
return;
}
<?php
/*
Plugin Name: Custom Post Type Archive Menu Links
Plugin URI: http://codeseekah.com/2012/03/01/custom-post-type-archives-in-wordpress-menus-2/
Description: Easily Add Custom Post Type Archives to the Nav Menus
Version: 1.1
Author: soulseekah
Author URI: http://codeseekah.com
License: GPL2