Skip to content

Instantly share code, notes, and snippets.

View gormus's full-sized avatar
💭
Never be cruel, never be cowardly.

Osman Gormus gormus

💭
Never be cruel, never be cowardly.
View GitHub Profile
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and PHP-FPM
sudo yum install -y nginx php-fpm
# Install PHP extensions
sudo yum install -y php-devel php-mysql php-pdo \
php-pear php-mbstring php-cli php-odbc \
@gormus
gormus / settings.php
Created December 16, 2013 03:23
Redis cache settings for Drupal 7 on Pantheon.
<?php
/**
* Redis cache settings for Pantheon.
*
* http://helpdesk.getpantheon.com/customer/portal/articles/401317
*
* All Pantheon Environments.
*/
if (defined('PANTHEON_ENVIRONMENT')) {
// Use Redis for caching. (mandatory).
@import url("http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600|Open+Sans+Condensed:300,700");
img {
border: 0;
max-width: 100%;
height: auto;
}
.group-header {
position: relative;
@gormus
gormus / gist:7489838
Created November 15, 2013 19:07
Based on the discussion found at foundation issue #1358 https://github.com/zurb/foundation/issues/1358#issuecomment-28546603
$(window).load(function() {
$("[data-match-height]").each(function() {
var parentRow = $(this),
childrenCols = $("> [data-height-watch]", this),
childHeights = childrenCols.map(function(){ return $(this).outerHeight(); }).get(),
tallestChild = Math.max.apply(Math, childHeights);
childrenCols.css('min-height', tallestChild);
});
});
@gormus
gormus / gist:5827011
Created June 20, 2013 21:49
Load JavaScript Asynchronously. Usage: _async('//example.com/script.js', 'dom-id'); Taken from Twitter and Facebook widget loader scripts and altered a little bit. :-P
/**
* Load JavaScript Asynchronously
*
* usage: _async('//example.com/script.js', 'dom-id');
*/
function _async(src, id) {
setTimeout(
function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {
@gormus
gormus / _custom_simple_mail.php
Created October 16, 2012 20:19 — forked from baisong/_custom_simple_mail.php
Drupal 7 function to send simple email to developer or administrator.
<?php
/**
* Sends a simple email.
* [or] Tested on 2012-05-31 using Drupal 7.12
*
* Usage:
* 1) Paste all the below code into your module or include
* 2) Configure the two @FIXME's.
* 3) Visit /_custom_simple_mail to get an email.
*
@gormus
gormus / 404.html
Created July 31, 2012 03:07
404 - Page not found
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>404 - Page not found!</title>
<style>
html, body {
background: #222;
color: #EEE;
@gormus
gormus / window-size.js
Created July 22, 2012 05:12
Appends an info box to body for displaying the window size. Box content is refreshed by the window resize.
$(document).ready(function () {
$('<div id="WINDOW_SIZE">' + $(window).width() + 'x' + $(window).height() + '</div>')
.attr('unselectable', 'on')
.css({
'position' : 'fixed',
'bottom' : 0,
'right' : 0,
'background' : '#000000',
'color' : '#FFFFFF',
'font' : '16px/1 sans-serif',
@gormus
gormus / gist:3020361
Created June 29, 2012 20:12
Drupal 7 - adding new view modes
<?php
/**
* Implements hook_entity_info_alter().
*/
function MYMODULE_entity_info_alter(&$info) {
$info['node']['view_modes'] += array(
'node_feature' => array(
'label' => t('Featured'),
'custom settings' => TRUE,
),
@gormus
gormus / sitemap.css
Created April 5, 2012 20:47
A generic CSS for styling sitemap menu links created by menu block module.
/* Sitemap */
#ui-content .ui-block-menu_block {
font-size: 13px;
}
#ui-content .ui-block-menu_block ul {
line-height: 1;
margin: 0;
float: left;
padding: 0;
}