Skip to content

Instantly share code, notes, and snippets.

View nkgokul's full-sized avatar

Gokul N K nkgokul

View GitHub Profile
@nkgokul
nkgokul / github_webhook.php
Last active August 29, 2015 14:13
Sanity check for Github Webhook
<?php
//Github sanity check
$secret = 'my_secret_entered_on_webhook_settings_page';
$headers = getallheaders();
$hubSignature = $headers['X-Hub-Signature'];
list($algo, $hash) = explode('=', $hubSignature, 2);
$payload = file_get_contents('php://input');
$data = json_decode($payload);
$payloadHash = hash_hmac($algo, $payload, $secret);
@nkgokul
nkgokul / virtualhosts
Created February 19, 2015 06:19
List all Virtual Hosts for Apache2 on Ubuntu
apache2ctl -S
@nkgokul
nkgokul / linux_list_all_folders_within_current_foler
Created February 19, 2015 06:53
List of all modules folders within the current folder
find . -name "*.info" -exec basename \{} .info \; | paste -s -d,
@nkgokul
nkgokul / gist:c38731caa5bc17ecc779
Created February 19, 2015 06:58
Drush List all enabled non core module in comma separated format.
drush pml --type=Module --status=Enabled --no-core --pipe | paste -s -d,
@nkgokul
nkgokul / git_commit_only_modified files
Created February 19, 2015 09:50
Git commit only modified files
git ls-files --modified
!! | git add
@nkgokul
nkgokul / drush_diesable_non_core_modules
Created February 19, 2015 15:28
Drush disable non core module - Useful for debugging
drush pml --no-core --type=module --status=enabled --pipe | xargs drush -y dis
@nkgokul
nkgokul / drupalxraytosimplytestme
Created February 23, 2015 08:45
Generate a link to SimplyTest.me from DrupalXray.com
var generateString = "http://simplytest.me/project/drupal/";
var drupalVersionString = jQuery(".xray-site div.xray-site-info:nth-child(3)").text();
var drupalVersion = drupalVersionString.split(": ").pop();
generateString += drupalVersion + "?";
jQuery(".xray-site-modules ul li a").each(
function(){
var url = jQuery(this).attr("href");
var lastPart = url.split("/").pop();
generateString += "add[]=" + lastPart + "&";
}
@nkgokul
nkgokul / drushqueryfromdrupalxray
Created February 23, 2015 08:53
Drush query from drupalxray
var drushString = "drush en --y ";
jQuery(".xray-site-modules ul li a").each(
function(){
var url = jQuery(this).attr("href");
var lastPart = url.split("/").pop();
drushString += lastPart + " ";
}
);
console.log(drushString);
@nkgokul
nkgokul / drupal_quick_siteinstall
Created February 23, 2015 10:52
Drupal Quick site install
drush dl drupal-6 --drupal-project-rename=drupal6
cd drupal6
drush si --db-url=mysql://root:@localhost/drupal6
@nkgokul
nkgokul / drupal_upgrade_status_to_csv
Created February 23, 2015 14:23
Export the Module Upgrade status(as a CSV file) when using Garland as admin theme
var finalString = '';
jQuery(".upgrade-status .project").each(function(){;
var title = jQuery("span.project-title a",this).text();
var moduleLink = jQuery("span.project-title a",this).attr("href");
var modulecode = jQuery("span.project-title a",this).attr("href").split("/").pop();
var status = jQuery("div.version-status:nth-child(1)",this).text();
var release = jQuery("div.versions .version-details a",this).text();
var link = jQuery("div.versions .version-details a",this).attr("href");
finalString += title + ',' + status + ',' + release + ',' + link + ',' + moduleLink + ',' + modulecode+'\n';
//console.log(title + ',' + status + ',' + release + ',' + link);