Skip to content

Instantly share code, notes, and snippets.

View visualizeq's full-sized avatar

Coke visualizeq

  • LINE BK
  • Bangkok
View GitHub Profile
diff --git a/src/auto/XSTools/utils/sparseconfig.h b/src/auto/XSTools/utils/sparseconfig.h
index c216315..3e1d600 100644
--- a/src/auto/XSTools/utils/sparseconfig.h
+++ b/src/auto/XSTools/utils/sparseconfig.h
@@ -59,7 +59,7 @@
#endif
/* the location of <hash_fun.h>/<stl_hash_fun.h> */
#if GCC_VERSION < 40300
- #define HASH_FUN_H <ext/hash_fun.h>
+ #define HASH_FUN_H <ext/hash_map>
@visualizeq
visualizeq / cck_field_rename.php
Created February 27, 2015 06:07
D7 CCK Field Rename
<?php
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$fields = array(
'field_tags' => 'field_carousel_tag',
);
// Loop through each of the fields/tables with the old name and change them

Local SSL websites on Mac OSX

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on Mac OSX Yosemite.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward edit to Sublime Text:

alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
@visualizeq
visualizeq / gist:3898061
Created October 16, 2012 08:35
Yii Request Config
'request' => array(
'class' => 'application.components.HttpRequest',
'enableCsrfValidation' => true,
'noCsrfValidationRoutes' => array(
'*',
),
),
@visualizeq
visualizeq / HttpRequest.php
Created October 16, 2012 08:34
Yii HttpRequest (CSRF)
<?php
class HttpRequest extends CHttpRequest {
public $noCsrfValidationRoutes = array();
/**
* Normalizes the request data.
* This method strips off slashes in request data if get_magic_quotes_gpc() returns true.
* It also performs CSRF validation if {@link enableCsrfValidation} is true.
*/
protected function normalizeRequest()
@visualizeq
visualizeq / gist:3898052
Created October 16, 2012 08:31
Yii Controller AccessRules
public function accessRules()
{
return array(
array('allow',
'actions' => array('index'),
'users' => array('*'),
),
array('deny',
'actions' => array('*'),
'users' => array('*'),
@visualizeq
visualizeq / gist:3898046
Created October 16, 2012 08:30
Yii Controller HttpsFilter
public function filterHttps($filterChain)
{
$filter = new HttpsFilter;
$filter->filter($filterChain);
}
@visualizeq
visualizeq / gist:3898043
Created October 16, 2012 08:29
Yii Controller Filters
public function filters()
{
// return the filter configuration for this controller, e.g.:
return array(
'accessControl',
'https',
);
}
@visualizeq
visualizeq / HttpsFilter.php
Created October 16, 2012 08:27
Yii HttpsFilter Class
<?php
class HttpsFilter extends CFilter {
protected function preFilter($filterChain) {
if (!Yii::app()->getRequest()->isSecureConnection) {
# Redirect to the secure version of the page.
$url = 'https://' .
Yii::app()->getRequest()->serverName .
Yii::app()->getRequest()->requestUri;
Yii::app()->request->redirect($url);
return false;
@visualizeq
visualizeq / index.html
Created April 3, 2012 11:07
HTML: Basic Structure
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript" src="//code.jquery.com/jquery-1.7.2.min.js"></script>
</head>
<body>
</body>