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
#include <vector> | |
#include <string> | |
#include <sstream> | |
#include "esphome/components/display/display_buffer.h" | |
#include "text_wrap.h" | |
using namespace esphome; | |
using namespace esphome::display; | |
void wrap_text(DisplayBuffer* it, int x, int y, const char* text, Font* font, TextAlign align, float line_height) { |
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
- (void)setupMapSnapshot | |
{ | |
CLLocationCoordinate2D coordinate = self.outlet.annotaion.coordinate; | |
MKMapSnapshotOptions* options = [MKMapSnapshotOptions new]; | |
options.size = self.mapImageView.frame.size; | |
options.scale = [[UIScreen mainScreen] scale]; | |
options.region = MKCoordinateRegionMakeWithDistance(coordinate, 2000.f, 2000.f); | |
MKMapSnapshotter* snapshotter = [[MKMapSnapshotter alloc] initWithOptions:options]; | |
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
module StaticMapHelper | |
def static_map_for(location, options = {}) | |
params = { | |
:center => [location.lat, location.lng].join(","), | |
:zoom => 15, | |
:size => "300x300", | |
:markers => [location.lat, location.lng].join(","), | |
:sensor => true | |
}.merge(options) |
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
//extension method make a database call by providing a function pointer to Task<T> and passing in a method parameter | |
public static async Task<T> DatabaseCall<T>(this IDatabase cache, string key, Func<string, Task<T>> databaseCall, string methodParameter, TimeSpan timeSpan, bool invalidate, bool useCache) | |
{ | |
T returnValue; | |
var cachedItem = default(T); | |
try | |
{ | |
cachedItem = await cache.GetAsync<T>(key); | |
} | |
catch (RedisConnectionException ex) |
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
using Bugsnag.Clients; | |
using System; | |
using System.Web.Mvc; | |
namespace MyAwesomeWebApp | |
{ | |
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)] | |
public sealed class BugsnagExceptionHandler : HandleErrorAttribute | |
{ | |
internal BugsnagExceptionHandler() |
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
var QUEUE_URL = 'https://sqs.us-east-1.amazonaws.com/{AWS_ACCUOUNT_}/matsuoy-lambda'; | |
var AWS = require('aws-sdk'); | |
var sqs = new AWS.SQS({region : 'us-east-1'}); | |
exports.handler = function(event, context) { | |
var params = { | |
MessageBody: JSON.stringify(event), | |
QueueUrl: QUEUE_URL | |
}; | |
sqs.sendMessage(params, function(err,data){ |
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"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>John's Recent Reviews</title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/css/bootstrap.css" rel="stylesheet"> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> |
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
<script src="https://d6at0twdth9j2.cloudfront.net/widget/v1/gallery.min.js" | |
data-key="your_api_token"> | |
</script> |
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"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Nearby Now Photo & video Gallery Widget</title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body> |
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
<!-- Add this script on the page that you want to embed the reviews widget --> | |
<script | |
src="https://s3.amazonaws.com/reviewcloud/widget/v2/reviews.min.js" | |
data-key="your_api_token"> | |
</script> | |
<!-- Add this div where you'd like the widget to display on your page --> | |
<div id="nn-reviews"></div> |
NewerOlder