Skip to content

Instantly share code, notes, and snippets.

View MKorostoff's full-sized avatar

Matt Korostoff MKorostoff

View GitHub Profile
<?php
function my_module_menu() {
return array(
'mypage' => array(
'page callback' => 'mypage_callback',
'access callback' => TRUE,
)
);
}
<?php
function my_module_menu() {
return array(
'mypage' => array(
'page callback' => 'mypage_callback',
'access callback' => TRUE,
)
);
}
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCagT1BDpra+WQqO/8MiMv43C85J/UYh9szvW+eHUokBAE8ArqmdqSM2j5d7hsqqBVVgE+eXytUTIe/1DF3+CftiJ+aZ4NDM3qlkiQ7GliI/k6Quuw/dc/3sHwxGS/WUHnubERFienrSaUuSWePvUfEc+lHe+IHRbEY/9uUUVC1UHpfigExBmmZQ0k0sgSVjuT/qs7zF1k7u1sXs9sKZHkGHUn3aMkUNrSxJTLL6F0gUr3bAlUEo0VQePodiW5VDDe3P6poJ+51YfgK1hZEgIrcqqbAuWK/kGqE0iWGbqLh8hw8/bgl4FI29QIrNikiDv5TDeenbLUKlNf1AmcVTM2f matt@blinkreaction.com
[user]
name = Matt Korostoff
email = REDACTED
[color]
ui = true
status = auto
branch = auto
interactive = auto
diff = auto
[core]
#!/bin/sh
function test_test() {
test -d "/some/invalid/directory" && ls -1 "/some/invalid/directory"
echo 1
}
test_test
#prints "1" without throwing an error
<?php
//Example 1: fetch all node IDs using db_select
$startTime = microtime(true);
$result = db_select('node', 'n')
->fields('n')
->execute()
->fetchAll();
echo "Elapsed time is: ". (microtime(true) - $startTime) ." seconds";
//prints 0.25 seconds
<?php
/**
* Tell page.tpl.php whether or not to show the sticky player
*/
function olympics_degradation_states_preprocess_page(&$vars) {
$vars['disable_sticky_player'] = variable_get('disable_sticky_player', FALSE);
}
{
"title": "Breaking: Tiger Woods Retires!",
"link_text": "Learn more",
"link_destination": "/article/tiger-woods-announces-retirement",
}
<?php
function cache_invalidation_node_presave($node) {
if(!empty($node->promote)) {//target front page content
//Clear drupal cache
cache_clear_all('http://cachedemo.local/', 'cache_page');
//Clear varnish cache
httprl_request( 'http://cachedemo.local/', array('blocking' => FALSE, 'method' => 'PURGE'));
<?xml version="1.0" encoding="utf-8"?>
<socialize.getUserInfoResponse
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:com:gigya:api http://socialize-api.gigya.com/schema"
xmlns="urn:com:gigya:api">
<statusCode>200</statusCode>
<errorCode>0</errorCode>
<statusReason>OK</statusReason>
<callId>86a7032a53ab4d2783d439f8d618938f</callId>
<UID>1463</UID>
<UIDSig>/9kvnGVdZoC575t2tQNIUZesSyo=</UIDSig>