Skip to content

Instantly share code, notes, and snippets.

View sanguis's full-sized avatar
👁️‍🗨️
DevOpsing all the things

Josh Beauregard sanguis

👁️‍🗨️
DevOpsing all the things
View GitHub Profile
@sanguis
sanguis / gist:2845349
Created May 31, 2012 18:47
scss config
#
# This file is only needed for Compass/Sass integration. If you are not using
# Compass, you may safely ignore or delete this file.
#
# If you'd like to learn more about Sass and Compass, see the sass/README.txt
# file for more information.
#
# Change this to :production when ready to deploy the CSS to the live server.
@sanguis
sanguis / gist:2898467
Created June 8, 2012 22:33
em vars for a 13px basefont
@6: 0.353em;
@7: 0.412em;
@8: 0.471em;
@9: 0.529em;
@10: 0.588em;
@11: 0.647em;
@12: 0.706em;
@13: 0.765em;
@14: 0.824em;
@15: 0.882em;
@sanguis
sanguis / gist:3042311
Created July 3, 2012 19:36
drupul compound hook_field_is_empty() function
<?php
/**
* Implements hook_field_is_empty().
*/
function FOO_contact_field_is_empty($item, $field) {
unset($item['_weight']);
$null = array_filter($item, 'isempty');
return empty($null);
}
@sanguis
sanguis / config.conf
Created September 14, 2012 14:15
drupal nginx config file for ubuntu 12.04 server
server {
server_name DOMAIN;
root /var/www/PATH;
index index.html index.htm index.php;
location = /favicon.ico {
log_not_found off;
access_log off;
}
@sanguis
sanguis / gist:4126095
Created November 21, 2012 17:07
a very intersting use of terninary operators
<?php
'#default_value' => empty($form_state['values']['ajax_example_2']) ?
$node->ajax_example['example_2'] :
$form_state['values']['ajax_example_2'],
@sanguis
sanguis / gist:4259600
Created December 11, 2012 15:57
views_query_alter() snippet date range
if (!empty($fields['min']['date']) || !empty($fields['max']['date'])) {
//date logic
if(!empty($fields['min']['date'])){
$min = new DateTime();
$mindate = explode("/", $fields['min']['date']);
$min->setDate($mindate[0],$mindate[1],$mindate[2]);
$min->setTime(00, 00, 00);
}
else {
$min = new DateTime('19900101');
<?php
$query = new EntityFieldQuery();
$query
->entityCondition('entity_type', 'node')
->fieldCondition('field_campaign_filename', 'value', $value '=')
$result = $query->execute();
?>
$(document).ready(function() {
$('#register-product-form > input[name="nid"][value="324"]').ready(function() {
$("#register-product-form > .register").children(":not(.slider)").remove();
$("#register-product-form > .submit-button").remove();
});
});
#auth_basic "Restricted";
#auth_basic_user_file /www/ht-live.password;
@sanguis
sanguis / .zshrc
Last active December 13, 2015 20:48
zshrc with oh my zsh settings and alaias's
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="gallois"
# Example aliases