Skip to content

Instantly share code, notes, and snippets.

View hasantayyar's full-sized avatar
⌨️
AFK

Hasan Tayyar Beşik hasantayyar

⌨️
AFK
View GitHub Profile
@gene1wood
gene1wood / all_aws_managed_policies.json
Last active April 4, 2024 18:11
A list of all AWS managed policies and they're policy documents as well as a short script to generate the list
This file has been truncated, but you can view the full file.
{
"APIGatewayServiceRolePolicy": {
"Arn": "arn:aws:iam::aws:policy/aws-service-role/APIGatewayServiceRolePolicy",
"AttachmentCount": 0,
"CreateDate": "2019-10-22T18:22:01+00:00",
"DefaultVersionId": "v6",
"Document": {
"Statement": [
{
@hasantayyar
hasantayyar / s32logentries.py
Created November 5, 2015 14:23
s3 to logentries aws lamda script
import json
import urllib
import boto3
import httplib
import re
import json
addr = '/%s/hosts/%s/%s?realtime=1' % ("accountkey","hostkey","logkey")
print('Loading function')
@rupey
rupey / mandelbrot.sql
Last active December 7, 2020 05:38
Mandelbrot plot in postgres
WITH RECURSIVE
x(i) AS ( VALUES (0)
UNION ALL SELECT i + 1
FROM x
WHERE i < 101),
Z(Ix, Iy, Cx, Cy, X, Y, I) AS (
SELECT
Ix,
Iy,
X :: FLOAT,
@hasantayyar
hasantayyar / dynamodb.md
Created July 14, 2015 07:43
dynamodb notes

Important note : Use " -sharedDb " flag whilde starting local dynamodb. otherwise js will use a different profile. And you can't access your tables what created from via cli or other platforms

$ wget http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.zip
$ unzip ...
....
$ sudo pip install awscli
$ ./DynamoDbLocal.jar --port 8787
@GilLevi
GilLevi / README.md
Last active July 25, 2023 18:05
Age and Gender Classification using Convolutional Neural Networks
@magnetikonline
magnetikonline / README.md
Last active June 7, 2023 20:57
AWS Elastic Beanstalk deploy user restricted IAM policy.

AWS Elastic Beanstalk deploy user restricted IAM policy

An IAM user policy document to give minimal rights for deploying an Elastic Beanstalk application.

Where:

  • REGION: AWS region.
  • ACCOUNT_ID: AWS account ID.
  • APPLICATION_NAME: Desired target Elastic Beanstalk application name(space).
  • IAM_INSTANCE_PROFILE_ROLE: The instance profile (IAM role) Elastic Beanstalk EC2 instaces will run under.
@imbradbrown
imbradbrown / upload-ssec.sh
Last active November 30, 2022 06:20
Uploading to Amazon S3 from curl with Server Side Encrpytion - Customer Provided Key used. Note that this uses the Amazon Access Keys which should be used with care.
#!/bin/bash
## file to upload.
S3_UPLOAD_FILE=some/path/file.txt
## Specify the bucket name here. This can be found in the S3 console
S3_BUCKET=bucket name here
## The desired path relative to the root of the bucket. All folders must be forward slash '/' separated
S3_DESTINATION_FILE=folder/folder2/file.txt
@tjamps
tjamps / README.md
Last active February 29, 2024 14:57
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :

@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@mks-m
mks-m / tiny_redis.rb
Last active April 7, 2021 16:47
tiny_redis_client.rb
# Copyright 2017 Maksym Melnychok
# MIT License - https://opensource.org/licenses/MIT
#
# inspired by https://github.com/ptrofimov/tinyredisclient
require 'socket'
class TinyRedis
RN = "\r\n"