Skip to content

Instantly share code, notes, and snippets.

@Ferdi
Ferdi / gist:3537100
Created August 30, 2012 18:40
submitted_by override
/**
* Implements hook_process_node().
*/
function os_blog_process_node(&$variables) {
// ... if this is a blog node type and ...
$variables['submitted'] = format_date($node->created, 'short'); // better to be specific then just "short"
}
@Ferdi
Ferdi / gist:3691598
Created September 10, 2012 15:36
zend_php_format
<?xml version="1.0" encoding="UTF-8"?>
<profiles>
<profile name="scholar_php_format">
<setting id="com.zend.php.formatter.core.formatter.alignment_for_arguments_in_allocation_expression_force_split" value="false"/>
<setting id="com.zend.php.formatter.core.formatter.alignment_for_arguments_in_allocation_expression_indent_policy" value="0"/>
<setting id="com.zend.php.formatter.core.formatter.alignment_for_arguments_in_allocation_expression_line_wrap_policy" value="0"/>
<setting id="com.zend.php.formatter.core.formatter.alignment_for_arguments_in_method_invocation_force_split" value="false"/>
<setting id="com.zend.php.formatter.core.formatter.alignment_for_arguments_in_method_invocation_indent_policy" value="0"/>
<setting id="com.zend.php.formatter.core.formatter.alignment_for_arguments_in_method_invocation_line_wrap_policy" value="0"/>
<setting id="com.zend.php.formatter.core.formatter.alignment_for_assignment_force_split" value="false"/>
module PreviouslyDirty
extend ActiveSupport::Concern
included do
attribute_method_suffix '_previously_changed?'
end
private
# Handle <tt>*_previously_changed?</tt> for +method_missing+.
function os_blog_os_feature_info() {
return array(
'group content' => array('blog'),
'settings' => TRUE, //OR
'form settings path' => 'xxxx',
);
}
@Ferdi
Ferdi / f
Created March 24, 2014 18:30
<iframe width="100%" height="450" scrolling="no" frameborder="no"
src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/playlists/4080125&color=ff5500&auto_play=false&amp;amp;hide_related=false&amp;amp;show_artwork=true">
</iframe>
<a class="twitter-timeline" href="https://twitter.com/osharvardstatus" data-widget-id="457247458108506112">Tweets by @osharvardstatus</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
@Ferdi
Ferdi / 0_reuse_code.js
Created May 30, 2014 19:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Ferdi
Ferdi / dabblet.css
Created February 16, 2015 23:25
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@Ferdi
Ferdi / dabblet.css
Created February 16, 2015 23:26
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;