Skip to content

Instantly share code, notes, and snippets.

Çağatay Gürtürk cagataygurturk

Block or report user

Report or block cagataygurturk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View cloudfront.cloudformation.yaml
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
ResourceRegion:
Type: String
Description: The region where the resource to be allowed is deployed
Default: eu-west-1
ResourceVpcId:
Type: String
Description: The VPC ID where the resource to be allowed is deployed
Conditions:
View findHttpResources.js
$(function ($) {
var scanInterval = 2000;
if(typeof window.performance.getEntriesByType === 'undefined') return;
var alreadyLoggedResources = {};
var logHttpResource = function(resourceName) {
if(alreadyLoggedResources.hasOwnProperty(resourceName)) {
return;
View cloudformation.no-www.json
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"DomainName": {
"Description": "Domain name you want to redirect (without www)",
"Type": "String"
},
"HostedZoneId": {
"Type": "AWS::Route53::HostedZone::Id",
"Description": "Route53 Hosted Zone Id that your domain is served in"
View cloudfront.cloudformation.json
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
ResourceRegion:
Type: String
Description: The region where the resource to be allowed is deployed
Default: eu-west-1
ResourceVpcId:
Type: String
Description: The VPC ID where the resource to be allowed is deployed
Conditions:
View cloudfront.lambda.js
/**
* This lambda function creates the necessary security group for Cloudfront
*/
const Region = '${ResourceRegion}'; //Hardcoded on Cloudformation template
const VpcId = '${ResourceVpcId}'; //Hardcoded on Cloudformation template
const AWS = require('aws-sdk');
const GroupName = 'Cloudfront-SecurityGroup';
const topicArn = 'arn:aws:sns:us-east-1:806199016981:AmazonIpSpaceChanged';
View lambada.2.json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"cloudformation:*",
"s3:*",
"lambda:*",
"execute-api:*",
View gist:625ea38e8679e39422c7f30a681e9e6e
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"cloudformation:*",
"s3:*",
"lambda:*",
"execute-api:*",
View lambada.1.java
@GET
@Path("/helloworld/{id}")
public Response indexEndpoint(@PathParam int id) {
return Response.status(200).entity("Hello world: " + id).build();
}
View zf2.404.php
<?php
public function onBootstrap(EventInterface $e){
$em = $e->getApplication()->getEventManager();
$em->attach(MvcEvent::EVENT_ROUTE, array(
$this,
'detachNotFoundStrategy'
) , 1);
}
View bootstrap.2.js
$('*[data-poload]').hover(function() {
var e = $(this);
e.off('hover');
$.get(e.data('poload'), function(d) {
e.popover({
content: d
}).popover('show');
});
});
You can’t perform that action at this time.