Skip to content

Instantly share code, notes, and snippets.

View matason's full-sized avatar

Chris Maiden matason

View GitHub Profile
jQuery(document).ready(function($) {
var parametersToPersist = ['region', 'community', 'content_types', 'page'];
var currentParams = getUrlVars(window.location.href);
var queryString = buildQuery(currentParams);
console.log(decodeURIComponent(queryString));
jQuery("a").not("a.ext").each(function(){
var href = jQuery(this).attr('href');
{
"type": "package",
"package": {
"name": "imag/ldap-bundle",
"version": "dev-master",
"source": {
"url": "https://github.com/matason/LdapBundle",
"type": "git",
"reference": "origin/master"
}
#include <stdio.h>
char * cards [2] [2] = {"0000", "1000", "0111", "1111"};
int main ()
{
printf("Address of cards is %p\n", &cards);
printf("Which can also be written %p\n", cards[0]);
@matason
matason / php_stomp.c
Created May 6, 2015 04:29
zend_object_store_get_object to Z_OBJ_P
diff --git a/php_stomp.c b/php_stomp.c
index 5e6f1e7..d9537b2 100755
--- a/php_stomp.c
+++ b/php_stomp.c
@@ -32,9 +32,10 @@
#include "ext/standard/php_smart_string.h"
#define FETCH_STOMP_OBJECT \
- i_obj = (stomp_object_t *) zend_object_store_get_object(stomp_object TSRMLS_CC); \
+ stomp_object_t *i_obj; \
@matason
matason / test
Created May 15, 2015 05:53
Isolated httpfs test
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
int main (int argc, char *argv[]) {
FILE *f;
FILE *ret;
int c;
@matason
matason / image-markup.html
Created November 11, 2015 14:26
Captioned and un-captioned image markup
<!-- Captioned image -->
<figure class="image pull-right"><img alt="Hello" height="75" src="img/test-image.png" width="100" />
<figcaption>Caption</figcaption>
</figure>
<!-- Un-captioned image -->
<img alt="Hello" class="pull-right" height="75" src="img/test-image.png" width="100" />
@matason
matason / .vimrc
Created September 27, 2013 10:23
noremap <Up> <NOP>
inoremap <Up> <NOP>
vnoremap <Up> <NOP>
noremap <Down> <NOP>
inoremap <Down> <NOP>
vnoremap <Down> <NOP>
noremap <Left> <NOP>
inoremap <Left> <NOP>
vnoremap <Left> <NOP>
noremap <Right> <NOP>
@matason
matason / vimbingo
Last active December 29, 2015 02:19
Vim Bingo at DrupalCampNW13, add your name on a new line and attend my talk on Sunday to be in with a chance of winning the book Practical Vim, signed by the author Drew Neil!
czettnersandor
janetrimmer
Eli-TW
:help
vimtutor
http://vimcasts.org/ - simply brilliant Vim screencasts.
http://pragprog.com/book/dnvim/practical-vim - buy it!
http://vimeo.com/vimlondon - videos from Vim London sessions.
http://vim-adventures.com/ - learn Vim while playing a game, unlock levels, pay for.
http://vimgolf.com/ - Pick a challenge, fire up Vim, and show us what you got.
https://github.com/carlhuda/janus/ - the Janus Vim distribution provides a minimal working environment using the most popular plug-ins and the most common mappings.
https://drupal.org/project/vimrc - customizes the vim text editor for editing Drupal-related files.
https://drupal.org/node/29325 - Configuring Vim
$thing_path = libraries_get_path('thing');
require_once($thing_path . '/thing.php');
$thing = new thing();
exit();