This file contains hidden or 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
/** @var \Drupal\user\Entity\User $user */ | |
$user = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id()); | |
$uuid = $user->uuid(); |
This file contains hidden or 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
# Inspirational sources: | |
# http://netflixroulette.net/api/ | |
# http://www.ivangabriele.com/php-how-to-use-4-methods-delete-get-post-put-in-a-restful-api-client-using-curl/ | |
# https://github.com/toddmotto/public-apis | |
function netflix_getter() { | |
$request = 'http://netflixroulette.net/api/api.php'; | |
json_decode($request); |
This file contains hidden or 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
sudo chown -R $(whoami) $(git rev-parse --show-toplevel)/.git |
This file contains hidden or 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
$(document).ready(function() { | |
$('div').click(function () { | |
$(this).effect('bounce', {times:3}, 500); | |
}); | |
}); |
This file contains hidden or 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
$(document).ready(function(){ | |
// Drop an image down from the top over one second interval | |
$('img').animate({ top: '+=100px'}, 1000 ); | |
}); |
This file contains hidden or 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
/** | |
* Implements hook_preprocess_htm(). | |
*/ | |
function THEME_preprocess_html(&$variables) { | |
$path = drupal_get_path_alias(); | |
$aliases = explode('/', $path); | |
foreach($aliases as $alias) { | |
$variables['classes_array'][] = 'page-alias-' . drupal_clean_css_identifier($alias); | |
} | |
} |
This file contains hidden or 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
/** | |
* Implements hook_preprocess_htm(). | |
*/ | |
function HOOK_preprocess_html(&$variables) { | |
$viewport = array( | |
'#tag' => 'meta', | |
'#attributes' => array( | |
'name' => 'viewport', | |
'content' => 'width=device-width, initial-scale=1, maximum-scale=1')); | |
drupal_add_html_head($viewport, 'viewport'); |
This file contains hidden or 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
/* As seen at http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/ */ | |
.element { | |
position: relative; | |
top: 50%; | |
transform: translateY(-50%); | |
} |
This file contains hidden or 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 |
NewerOlder