Skip to content

Instantly share code, notes, and snippets.

View neclimdul's full-sized avatar

James Gilliland neclimdul

View GitHub Profile
@neclimdul
neclimdul / import-all.sh
Created February 5, 2011 18:30
Import all d.o projects
#!/bin/sh
if [ ! $C2G_CONCURRENCY ]; then
C2G_CONCURRENCY=8 # set to the number of cores you want to pwn with the migration process
fi
if [ ! $C2G_REPOSITORY ]; then
C2G_REPOSITORY=/var/git/cvsmirror # replace with path to the root of the local repository
fi
if [ ! $C2G_DESTINATION ]; then
C2G_DESTINATION=/var/git/repositories
@neclimdul
neclimdul / get.inc
Created June 22, 2011 21:54
GET access argument
<?php
/**
* @file
* Plugin to provide access control/visibility based on specified get argument matching user-specified string
*/
$plugin = array(
'title' => t("GET: comparison"),
'description' => t('Control access by comparing a GET argument.'),
'callback' => 'ctools_get_ctools_access_check',
@neclimdul
neclimdul / compress_png
Created July 20, 2011 16:42
Quick script built to compress and prep pngs for websites using pngcrush and optipng
#!/bin/bash
function compress {
echo "Crushing $1"
pngcrush -rem gAMA -rem cHRM -rem iCCP -rem sRGB $1 compressed/$1 > /dev/null
mv compressed/$image ./
echo "Compressing $1"
optipng -o9 $1 > /dev/null
}
@neclimdul
neclimdul / ConfigDiscovery.php
Created April 16, 2012 22:05
configdiscoverything
<?php
/**
*
*
*/
namespace Drupal\Core\Plugin\Discovery;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
@neclimdul
neclimdul / gist:3265570
Created August 5, 2012 16:12
Tekkit init.d script for debian(ubuntu)
#!/bin/sh
### BEGIN INIT INFO
# Provides: minecraft
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: true
# Short-Description: Start/stop Tekkit minecraft server
# Description: This file should be used to construct scripts to be
@neclimdul
neclimdul / wapply.log
Last active December 10, 2015 23:58
wapply git alias
$ git wapply --index http://drupal.org/files/session-ph53_0.patch
$ » git st
## 8.x
M core/includes/bootstrap.inc
M core/lib/Drupal/Core/CoreBundle.php
A core/lib/Drupal/Core/Session/Handler/DatabaseSessionHandler.php
A core/lib/Drupal/Core/Session/Proxy/CookieOverrideProxy.php
A core/lib/Drupal/Core/Session/Session.php
A core/lib/Drupal/Core/Session/StaticSessionFactory.php
A core/lib/Drupal/Core/Session/Storage/DrupalSessionStorage.php
<?php
/**
* @file
* Contains \Drupal\Core\Plugin\DefaultPluginManager
*/
namespace Drupal\Core\Plugin;
use Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface;
<?php
/**
* @file
* Contains Drupal\Core\Plugin\Discovery\YamlDiscovery.
*/
namespace Drupal\Core\Plugin\Discovery;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
<?php
// Don't cache any cart of checkout pages.
// Code based on CacheExclude - http://drupal.org/project/cacheexclude
if (arg(0) == 'cart') {
drupal_page_is_cacheable(FALSE);
return;
}
@neclimdul
neclimdul / new_gist_file.diff
Created October 10, 2013 14:27
update.php route
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 5632cce..6ce4653 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -105,14 +105,16 @@ function system_help($path, $arg) {
$output = '<p>' . t('Download additional <a href="@modules">contributed modules</a> to extend Drupal\'s functionality.', array('@modules' => 'http://drupal.org/project/modules')) . '</p>';
if (module_exists('update')) {
if (update_manager_access()) {
- $output .= '<p>' . t('Regularly review and install <a href="@updates">available updates</a> to maintain a secure and current site. Always run the <a href="@update-php">update script</a> each time a module is updated.', array('@update-php' => $base_url . '/core/update.php', '@updates' => url('admin/reports/updates'))) . '</p>';
+ $output .= '<p>' . t('Regularly review and install <a href="@updates">available updates</a> to maintain a secure and current site. Always run the <a