Skip to content

Instantly share code, notes, and snippets.

<?php
// $Id: $
/**
* @file
* pathauto.drush.inc
*/
/**
* Implementation of hook_drush_command().
*

How To Install Linux, NginX, MariaDB, PHP5 (LEMP) stack on CentOS 6.5 x64 using Centmin Mod

Quick start


For this tut, You'll need a VPS or dedicated server with full root user + SSH2 telnet access to install Centmin Mod (For LEMP installation and Management). I'll be using a 1GB memory VPS from DigitalOcean as they got Cheap VPS hosting which are awesome!

In this tut, We'll be setting up latest version of NginX, MariaDB, PageSpeed and PHP.

@napoler
napoler / run.sh
Last active August 29, 2015 14:13 — forked from olragon/run.sh
#!/usr/bin/env bash
sudo hhvm --config site1.hhvm.hdf --user www-data --mode daemon -v "Log.Level=Verbose" -v "Log.NoSilencer=on" -v "Log.Header=on"
@napoler
napoler / hhvminfo.php
Last active August 29, 2015 14:13 — forked from ck-on/hhvminfo.php
<?php
/*
HHVMinfo - phpinfo page for HHVM HipHop Virtual Machine
Author: _ck_
License: WTFPL, free for any kind of use or modification, I am not responsible for anything, please share your improvements
Version: 0.0.6
* revision history
0.0.6 2014-08-02 display fix for empty vs zero
0.0.5 2014-07-31 try to determine config file from process command line (may not always work), style improvements
<?php
/*
Make Sure you include:
ctools_include('modal');
ctools_modal_add_js();
On the pages you put your link.
*/
@napoler
napoler / bgp-async.php
Last active August 29, 2015 14:25 — forked from gielfeldt/bgp-async.php
Asynchronous PHP with Background Process
<?php
// Fetch main feed.
// Main feed at /items.json
// Individual item feeds at /item/<id>.json
$url = 'http://example.com/items.json';
$result = drupal_http_request($url);
$data = drupal_json_decode($result->data);
diff --git a/includes/module.inc b/includes/module.inc
index 06bc979..3d2e468 100644
--- a/includes/module.inc
+++ b/includes/module.inc
@@ -892,12 +892,14 @@ function module_invoke($module, $hook) {
* @see drupal_alter()
*/
function module_invoke_all($hook) {
+ $times = [];
$args = func_get_args();
@napoler
napoler / viral_gate.html
Last active August 29, 2015 14:26 — forked from adamloving/viral_gate.html
Viral Gate - how to require liking, sharing, or tweeting to reveal content.
<html>
<body>
<!--
This page demonstrates how to hide some content on the page until the
viewer clicks one of the social sharing buttons.
You can see a live demonstration of this technique on this blog post:
http://adamloving.com/internet-programming/gamify
@napoler
napoler / User has Role
Last active August 28, 2015 19:05 — forked from brandonratz/User has Role
Drupal
<?php
// Load the currently logged in user.
global $user;
// Check if the user has the 'editor' role.
if (in_array('editor', $user->roles)) {
// do fancy stuff
}
?>