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
// Pure CSS Donut Chart | |
// By: Jerry Low | |
// How to use sample: https://codepen.io/jerrylow/pen/KKdNXbJ | |
.donut { | |
--donut-size: 300px; | |
--donut-border-width: 20px; | |
--donut-spacing: 0; | |
--donut-spacing-color: 255, 255, 255; | |
--donut-spacing-deg: calc(1deg * var(--donut-spacing)); |
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
<!-- | |
This disables app transport security and allows non-HTTPS requests. | |
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better | |
approach is to fix the non-secure resources. However, this patch will work in a pinch. | |
To apply the fix in your Ionic/Cordova app, edit the file located here: | |
platforms/ios/MyApp/MyApp-Info.plist | |
And add this XML right before the end of the file inside of the last </dict> entry: |
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 | |
// Example using cookie auth. | |
print (string) \Drupal::httpClient() | |
->get('http://example.com/node/1', [ | |
'headers' => ['Accept' => 'application/json'], | |
'cookies' => ['SESS07e0668737e9f97189850d2cf0c79892' => 'dasGegKQ6ZzEF0xvRZWWzwrl9tt7UT8fGuXrAeLC9P1'], | |
]) | |
->getBody(TRUE); |
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
[ { "gentilico" : "afegãne", | |
"nome_pais" : "Afeganistão", | |
"nome_pais_int" : "Afghanistan", | |
"sigla" : "AF" | |
}, | |
{ "gentilico" : "sul-africana", | |
"nome_pais" : "África do Sul", | |
"nome_pais_int" : "South Africa", | |
"sigla" : "ZA" | |
}, |
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
//If you have a Bridging-Header: | |
#import <FBSDKCoreKit/FBSDKCoreKit.h> | |
#import <FBSDKLoginKit/FBSDKLoginKit.h> | |
//In your AppDelegate: | |
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [String: AnyObject]?) -> Bool { | |
//App launch code | |
FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions) | |
//Optionally add to ensure your credentials are valid: |
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
/** | |
An API Route | |
*/ | |
protocol APIRoute { | |
var method: Alamofire.Method { get } | |
var encoding: Alamofire.ParameterEncoding { get } | |
var path: String { get } | |
var parameters: [String: AnyObject]? { get } | |
var requestConvertible: APIRequestConvertible { get } | |
} |
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
// DropdownTableViewController.h | |
#import <UIKit/UIKit.h> | |
//Declaração do delegate que deve ser implementado por quem importar | |
//Se quiser, você pode criar métodos opcionais colocando abaixo de @optional | |
@protocol DropdownDelegate <NSObject> | |
- (void)setField:(NSString *)texto withValue:(NSNumber *)valor; |
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
heights = [2, 5, 1, 2, 3, 4, 7, 7, 6] | |
totalWater = 0 | |
for index in range(0, len(heights)): | |
currentHeight = heights[index] | |
maxLeftHeight = max(heights[:index]) if index > 0 else 0 | |
maxRightHeight = max(heights[index:]) | |
smallestMaxHeight = min(maxLeftHeight, maxRightHeight) | |
water = smallestMaxHeight - currentHeight if smallestMaxHeight - currentHeight > 0 else 0 |
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
// -------------------------------------------------- | |
// Flexbox LESS mixins | |
// The spec: http://www.w3.org/TR/css3-flexbox | |
// -------------------------------------------------- | |
// Flexbox display | |
// flex or inline-flex | |
.flex-display(@display: flex) { | |
display: ~"-webkit-@{display}"; | |
display: ~"-ms-@{display}box"; // IE10 uses -ms-flexbox |
NewerOlder