Skip to content

Instantly share code, notes, and snippets.

View oneblackcrayon's full-sized avatar

Frederick Polk oneblackcrayon

View GitHub Profile
@kmgdevelopment
kmgdevelopment / gist:3048845
Created July 4, 2012 18:42
ExpressionEngine Parse Order
<table>
{exp:channel:entries
channel="mychannel"
dynamic="no"
disable="categories|category_fields|member_data"
orderby="title"
sort="asc"
}
<tr>
{low_variables_var}
@EpocSquadron
EpocSquadron / perm.sh
Created August 3, 2012 14:12
ExpressionEngine Permissions File
#!/bin/bash
# Find location of this script.
# This ensures that only files in the directory in
# which this script exists (recursively) are modified.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Set what the name of your expressionengine folders are.
SYSTEM="system"
IMAGES_DIR="public_html/images"
<?php
// include the Tumblr PHP file. The directory is up to your choosing.
include ("lib/tumblrPHP.php");
// Enter your Consumer / Secret Key:
$consumer = "CONSUMER_KEY";
$secret = "SECRET_KEY";
// Start the Session
session_start();
<ul>
{exp:weblog:entries weblog="notes" offset="200"}
<li><a href="/exp/{entry_id}/{entry_date format="%Y-%m-%d"}-{url_title}.md">{title}</a></li>
{/exp:weblog:entries}
</ul>
@oneblackcrayon
oneblackcrayon / CreatePreyRecovery.sh
Created August 16, 2012 00:08 — forked from oschrenk/CreatePreyRecovery.sh
Secure MacBook w/ FileVault 2 and Prey
#!/bin/bash
#
# source: https://groups.google.com/d/msg/prey-security/vBv3BGI8Qeg/5xIy0LZjzXAJ
#
# Mount the recovery partition
/usr/bin/sudo /usr/sbin/diskutil mount Recovery\ HD
#
# Backup the recovery boot image
/usr/bin/sudo /bin/cp /Volumes/Recovery\ HD/com.apple.recovery.boot/BaseSystem.dmg ~/Desktop/
#
@AaronTrazona
AaronTrazona / example-fileupload.html
Created August 16, 2012 20:28 — forked from joewood/example-fileupload.html
Using JQuery File Upload with client resize
<-- Example HTML/JS of how to use the JQuery File Upload library, with resizing -->
<!DOCTYPE html >
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>this is My Child</title>
<script src="scripts/jquery-1.7.2.js" type="text/javascript"></script>
@oneblackcrayon
oneblackcrayon / s-maintenance-mode.php
Created August 16, 2012 21:56 — forked from mjangda/s-maintenance-mode.php
Custom WordPress maintenance mode that allows super admins access to the Dashboard
<?php
add_action( 'init', 'x_maintenance_mode' );
function x_maintenance_mode() {
if ( defined( 'X_MAINTENANCE_MODE' ) && true === X_MAINTENANCE_MODE ) {
if ( is_super_admin() && is_admin() )
return;
die( 'Site is currently under maintenance' );
@jjeaton
jjeaton / awesome-wp-config-file.php
Created August 16, 2012 23:30 — forked from ashfame/awesome-wp-config-file.php
awesome-wp-config-file
<?php
/**
* Define type of server
*
* Depending on the type other stuff can be configured
* Note: Define them all, don't skip one if other is already defined
*/
define( 'DB_CREDENTIALS_PATH', dirname( ABSPATH ) ); // cache it for multiple use
@marcedwards
marcedwards / high-dpi-media.css
Last active March 2, 2025 20:24
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@ocean90
ocean90 / plugin.php
Created September 4, 2012 15:18
WordPress: Return the X-XSS-Protection = 0 header for post previews
/**
* Add a X-XSS-Protection = 0 header for post previews to allow
* Webkit browsers to render iframe and flash objects.
* @see: http://core.trac.wordpress.org/ticket/20148
*
* @param $headers array Already added header items.
* @param $object WP The query variables.
*
* @return array
*/