Skip to content

Instantly share code, notes, and snippets.

View oneblackcrayon's full-sized avatar

Frederick Polk oneblackcrayon

View GitHub Profile
@oneblackcrayon
oneblackcrayon / StripeTutorialPage.html
Created January 2, 2012 03:16
Stripe Tutorial Payment Form
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
// this identifies your website in the createToken call below
@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/
#
@oneblackcrayon
oneblackcrayon / .htaccess protection
Created August 16, 2012 01:02 — forked from jonathonbyrdziak/.htaccess protection
htaccess Security :: A compilation of .htaccess commands to make your website more secure.
#################################
## FORCE SERVER TO RUN PHP5
#Action php5-script /gs-bin/php-5.1.6-6
#AddHandler php5-script .php
AddType x-mapp-php5 .php
##############################################################
## Authorization required to access the entire website
## This authorization eliminates anybody from being able to access the website
@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' );
<?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
@oneblackcrayon
oneblackcrayon / 0_reuse_code.js
Created November 22, 2013 22:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@font-face {
font-family: 'EntypoRegular';
src: url('font/entypo.eot');
src: url('font/entypo.eot?#iefix') format('embedded-opentype'),
url('font/entypo.woff') format('woff'),
url('font/entypo.ttf') format('truetype'),
url('font/entypo.svg#EntypoRegular') format('svg');
font-weight: normal;
font-style: normal;
}
// -------------------------------------------------------------- //
// APPLICATION GLOBAL ------------------------------------------- //
// -------------------------------------------------------------- //
// These files need app-required.sass (theme and variables and mixins)
// to load. The files imported here are global CSS that will apply to
// all applications and, ideally, never need to be recompiled per app.
@import app-required.sass // import the stuff required for compile
// Styles
// Simple Responsive Grid
// based on Chris Eppstein's SASS responsive layouts
// http://chriseppstein.github.com/blog/2011/08/21/responsive-layouts-with-sass/
// -------------------------------------------------------------- //
// DESKTOP - LARGE - %desktop-large ----------------------------- //
// -------------------------------------------------------------- //
// 1024px and up to 1280px at which it becomes fixed
@media all and (min-width: 1024px)
<?php
/* Register custom post types on the 'init' hook. */
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 0.1.0
* @access public