- Consumer: client
- Service Provider: server
- User: resource owner
- Consumer Key and Secret: client credentials
- Request Token and Secret: temporary credentials
- Access Token and Secret: token credentials
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 | |
//Sometimes we need to submit only part of the form. Sure, if form has #required fields, all they will be highlighted with red, | |
//and form will not be submitted if these elements have no value. | |
//To workaround this, we can use '#limit_validation_errors' option AND custom submit function for every 'Partial Submit' button. | |
//Interesting note: when we use '#limit_validation_errors', we will see ALL form fields in _validate function, | |
//but in _submit function will be visible ONLY elements, included in '#limit_validation_errors' array!!! | |
//Case 1. The most simple. | |
//We want to make a 'reset' button, or 'previous step' button, so it must work even if some REQUIRED form elements are empty: |
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
// Get image settings array from a field on the node | |
$image = field_get_items('node', $node, 'INSERT_IMAGE_FIELD_MACHINE_NAME'); | |
// Picture settings | |
$picture_mapping = picture_mapping_load('INSERT_PICTURE_MAPPING_MACHINE_NAME'); | |
$fallback = 'INSERT_IMAGE_STYLE_MACHINE_NAME'; | |
$breakpoints = picture_get_mapping_breakpoints($picture_mapping, $fallback); | |
// Create a new variable to pass through to the node template | |
$variables['INSERT_NEW_VARIABLE_NAME_TO_PASS_TO_NODE_TEMPLATE'] = theme('picture', array('uri' => $image[0]['uri'], 'style_name' => $fallback, 'breakpoints' => $breakpoints)); |
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 php | |
<?php | |
use Symfony\Component\Console\Application; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Console\Input\InputArgument; | |
require 'vendor/autoload.php'; | |
$app = new Application; |
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/perl | |
#fetch Gravatars | |
use strict; | |
use warnings; | |
use LWP::Simple; | |
use Digest::MD5 qw(md5_hex); | |
my $size = 90; |