Skip to content

Instantly share code, notes, and snippets.

View CashWilliams's full-sized avatar

Cash Williams CashWilliams

View GitHub Profile
@CashWilliams
CashWilliams / gist:8733693
Created January 31, 2014 15:03
Markdown Example

An exhibit of Markdown

This note demonstrates some of what [Markdown][1] is capable of doing.

Note: Feel free to play with this page. Unlike regular notes, this doesn't automatically save itself.

Basic formatting

Paragraphs can be written like so. A paragraph is the basic block of Markdown. A paragraph is what text will turn into when there is no reason it should become anything else.

" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" Allow backgrounding buffers without writing them, and remember marks/undo
" for backgrounded buffers
set hidden
" Remember more commands and search history
# set a really simple PS1
# will likly get overridden below
PS1='\[\e[1;31m\]\w\[\e[m\]\n\$ '
# inclue megalodon stuff
if [ -f ~/.megalodon.profile ] ; then
source ~/.megalodon.profile
fi
# Load RVM into a shell session *as a function*
@CashWilliams
CashWilliams / gist:3504611
Created August 28, 2012 21:44
Drupal memcache compression
$conf['memcache_options'] = array(
Memcached::OPT_COMPRESSION => TRUE,
);
@CashWilliams
CashWilliams / drupal.cow
Created August 8, 2012 20:19
Drupal cowsay
$the_cow = <<"EOC";
$thoughts ..Z..
$thoughts .7,#8
$thoughts ...Z.=###..
..=.=Z######Oo..
..N. .~+###########~.
..8. ..~7##############8.
..?.. .~~##################D.
... ..+=#Z####################~.
? ....~=#########################8.
<?php
function grades_gsc_block_contents() {
include "grades.template.inc";
global $user, $base_url;
drupal_add_js(drupal_get_path('module', 'ntlp_blocks') . '/grades.contents.js');
$user_id = $user->uid;
if ($courseid == 0) {
//Getting Query String From URL
@CashWilliams
CashWilliams / dbprefix.drush.inc
Created July 24, 2012 14:56
drush dbprefix command
<?php
/**
* @file
* Add and Remove prefix commands.
*
* You can copy this file to any of the following
* 1. A .drush folder in your HOME folder.
* 2. Anywhere in a folder tree below an active module on your site.
* 3. /usr/share/drush/commands (configurable)
<?php
function example_menu() {
$items[] = array();
$items['some/pointless/url'] = array(
'title' => t('Some Pointless Title'),
'page callback' => 'pointless_navigator',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
@CashWilliams
CashWilliams / coder_6x-2x_markdown.patch
Created July 12, 2012 04:35
Coder 6.x-2.x Markdown Patch
diff --git a/coder.drush.inc b/coder.drush.inc
index 47ab9bf..33b85d9 100644
--- a/coder.drush.inc
+++ b/coder.drush.inc
@@ -53,6 +53,7 @@ function coder_drush_command() {
'security' => 'Drupal Security Checks',
'sql' => 'Drupal SQL Standards',
'style' => 'Drupal Coding Standards',
+ 'markdown' => 'Output in markdown',
),
#!/bin/bash
for i in {`drush $1 pml --status=enabled -p | grep ntlp | cut -d " " -f 1`}
do
drush $1 coder critical $i > $i.md
done