This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
PROBLEM="$(cat /etc/hosts | grep tableausoftware.com | grep -v '^#' | wc -w)" | |
SAY=${1:-"omg fix yer hosts"} | |
if [ "$PROBLEM" -gt 0 ]; then | |
say $SAY | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias nginx.start='sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist' | |
alias nginx.stop='sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.nginx.plist' | |
alias nginx.restart='nginx.stop && nginx.start' | |
alias php-fpm.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php53.plist" | |
alias php-fpm.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php53.plist" | |
alias php-fpm.restart='php-fpm.stop && php-fpm.start' | |
alias mysql.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist" | |
alias mysql.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Suggested by mikeytown2 for faster DB | |
* @see https://www.drupal.org/node/1650930#comment-8437127 | |
*/ | |
/* -- Delete this line if you want to use this | |
$databases['default']['default']['init_commands'] = array( | |
'isolation' => "SET SESSION tx_isolation='READ-COMMITTED'" | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//assuming $node exists | |
$my_collection = entity_create('field_collection_item', array('field_name' => 'field_my_collection')); | |
$my_collection->setHostEntity('node', $node); | |
$my_collection->field_text_data[LANGUAGE_NONE][0]['value'] = "hello"; | |
$my_collection->field_term_ref[LANGUAGE_NONE][0]['tid'] = 123; | |
$my_collection->field_node_ref[LANGUAGE_NONE][0]['target_id'] = 345; | |
$my_collection->save(); | |
node_save($node); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="gallery-item"> | |
</div> | |
<div class="gallery-item"> | |
</div> | |
<div class="gallery-item"> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cross-scope compatible placeholder boilerplate. | |
@mixin my-mixin($extend: true) { | |
@if $extend { | |
@extend %my-mixin; | |
} | |
@else { | |
// Mixin core | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="gallery-item">1</div> | |
<div class="gallery-item">2</div> | |
<div class="gallery-item">3</div> | |
<div class="gallery-item">4</div> | |
<div class="gallery-item">5</div> | |
<div class="gallery-item">6</div> | |
<div class="gallery-item">7</div> | |
<div class="gallery-item">8</div> | |
<div class="gallery-item">9</div> | |
<div class="gallery-item">10</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = remote_stream_wrapper_file_create_by_uri($uri); | |
$file_result = file_save($file); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Form</title> | |
</head> | |
<body> | |
<form> |