Skip to content

Instantly share code, notes, and snippets.

@soulston
soulston / .htaccess
Last active August 29, 2015 14:27 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@soulston
soulston / gist:70ca504cff95856d6f77
Created October 20, 2014 16:10
Python: using ini files
# See https://wiki.python.org/moin/ConfigParserExamples
import ConfigParser
Config = ConfigParser.ConfigParser()
# [EBS]
# funnelback_volume_id: vol-5d61515f
#
# [example]
_funnelbackFetchDocIdByCsi
Add/Update - The server responded: 500
HTTP ERROR 500
Problem accessing /s/search.html. Reason:
Java heap space
Caused by:
java.lang.OutOfMemoryError: Java heap space
if bootUp.args.instanceType in ["All", "ebs-vol"]:
reportLines = []
mainLogger.info ("Looking for EBS Volumes in region: %s." % (region.name))
conEC2 = boto.ec2.connect_to_region (region.name,
aws_access_key_id=bootUp.args.awsAccessKey,
aws_secret_access_key=bootUp.args.awsSecretKey)
THEME FUNCTION
function ln_funnelback_theme() {
return array(
'ln_funnelback_results' => array(
'arguments' => array('results' => NULL, 'pager' => NULL),
'template' => 'ln_funnelback_results',
),
'ln_funnelback_contextual_nav_block' => array(
'arguments' => array('summary' => NULL, 'contextual_nav' => NULL),
/**
* Override or insert variables into the node template.
*/
function MYTHEME_preprocess_node(&$variables) {
if ($variables['node']->type == 'article') {
kpr($variables['node']);
$node = $variables['node'];
if (isset($variables['node']->field_file)) {
$file = field_get_items('node', $node, 'field_file');
$file = reset($file);
/**
* @file
* Provides special token to use with pathauto.
*
* http://drupal.org/node/1308488
*/
// We are using the sanitization functions from pathauto
require_once(drupal_get_path('module', 'pathauto') . '/pathauto.inc');
@soulston
soulston / code.php
Last active December 18, 2015 19:09
$titles = array();
foreach ($order->products as $product) {
$titles[] = $product->title;
}
// dpm($titles);
$titles = implode('<br />', $titles);
import os
# here() gives us file paths from the root of the system to the directory
# holding the current file.
here = lambda * x: os.path.join(os.path.abspath(os.path.dirname(__file__)), *x)
PROJECT_ROOT = here("..")
# root() gives us file paths from the root of the system to whatever
# folder(s) we pass it starting at the parent directory of the current file.
root = lambda * x: os.path.join(os.path.abspath(PROJECT_ROOT), *x)

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg