Skip to content

Instantly share code, notes, and snippets.

diff --git a/.travis.yml b/.travis.yml
index ae19cd2..e24bc8d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -30,9 +30,9 @@ env:
matrix:
allow_failures:
- - env: SCRIPT='modules/relaxed/tests/bin/drupal.sh' MAKE_FILE=drupal-8.3.x.make.yml
- - env: SCRIPT='modules/relaxed/tests/bin/pouchdb.sh' MAKE_FILE=drupal-8.3.x.make.yml
@sameronline
sameronline / get_image_info.php
Created November 23, 2012 15:19
php function that returns width/height/square space & file size of an image
function get_image_info($sURL) {
try {
$return = array();
$vData = "";
$timer = microtime(true);
$hSock = fopen($sURL, 'rb');
$length = 10240;
if ($hSock) {
while(!feof($hSock)) {
$vData = fread($hSock, $length);
<?php if($node->comment == 2 OR $comments){ ?>
<div id="comments" class="section comments">
<?php if($node->comment == 2){ ?>
<h3>
<?php
if ($node->type == 'baby_name'):
$default_title = t('What do you think about the name !s ?', array('!s' => $node->title));
else:
$default_title = t('What do you think?');
endif;
@sameronline
sameronline / fix-conflicts.sh
Created January 17, 2012 01:22
TP Conflicts Fixing
drush fcr tp_feature_mobile box header_ad -y
drush fcr tp_feature_mobile box site_logo -y
drush fcr tp_feature_homepage box city_map -y
drush fcr tp_feature_homepage box connect_with_todays_parent -y
drush fcr tp_feature_homepage box facebook_activity -y
drush fcr tp_feature_homepage box search -y
drush fcr tp_feature_homepage box twitter -y
@sameronline
sameronline / sample.rss
Created January 16, 2012 16:35
RSS Feed sample
<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Pregnancy</title>
<description>Get information on your pregnancy, baby, breastfeeding, baby food, newborn baby sleep, health, and the stages of growth and development.</description>
<link>http://tp.local</link>
<item>
<title>How to choose a baby name</title>
<description>Naming your baby is one of the hardest things you will ever do. Here are some do&amp;#039;s and don&amp;#039;ts</description>
<link>http://tp.local/pregnancy/baby-names/how-choose-baby-name</link>
<?php
// add support/detection for DEPRECATED in case of 5.3 PHP || Settings fix
if(defined('E_DEPRECATED')){
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING & ~E_DEPRECATED);
}else{
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
}
@sameronline
sameronline / correct.html
Created January 11, 2012 16:12
Featured Item block
<a href="#"><img src="_media/images/home/11.jpg" width="650" height="307" alt=""></a>
<div>
<h2><a href="#">How <em>she</em> does it?</a></h2>
<p><a href="#">Venenatis eleifend erat in fermen- tum. Etiam ornare urna non dolor egestas</a></p>
</div>
@sameronline
sameronline / all_users.sql
Created December 16, 2011 17:44
newsletters
SELECT
users.`name`,
users.uid,
content_type_user_profile.field_user_firstname_value,
content_type_user_profile.field_user_lastname_value,
content_type_user_profile.field_user_displayname_value,
content_type_user_profile.field_user_postalcode_value,
content_type_user_profile.field_user_tks_optin_value,
content_type_user_profile.field_user_agreeterms_value,
content_type_user_profile_newsletter.field_user_newsletter_tpages_value,
@sameronline
sameronline / gist:1435978
Created December 5, 2011 23:54
customformatter example
<?php
function hook_field_formatter_info() {
return array(
'youtube_video' => array(
'label' => t('Youtube Video'),
'field types' => array('text'),
)
);
}
@sameronline
sameronline / +youtube.com
Created December 5, 2011 21:51
Ebay Description template
<p align="center">
<object height="385" width="640"><param
name="movie"
value="http://www.youtube.com/v/XXXXXXXXXXX?fs=1&amp;hl=en_US"><param
name="allowFullScreen" value="true"><param
name="allowscriptaccess" value="always">
<embed src="http://www.youtube.com/v/XXXXXXXXXXX?fs=1&amp;hl=en_US"
type="application/x-shockwave-flash" allowscriptaccess="always"
allowfullscreen="true" height="385" width="640"></object></span></strong></p>