Skip to content

Instantly share code, notes, and snippets.

View ahmetgeymen's full-sized avatar

Ahmet Geymen ahmetgeymen

  • Valensas
  • Istanbul, Turkey
View GitHub Profile
@ahmetgeymen
ahmetgeymen / countries_en.json
Last active November 9, 2021 15:53
List of countries with phone codes - [EN, TR]
{
"countries": [{
"code": "AF",
"name": "Afghanistan",
"phoneCode": "93"
},
{
"code": "AL",
"name": "Albania",
"phoneCode": "355"
@ahmetgeymen
ahmetgeymen / index.html
Created December 28, 2020 00:18
OAuth Authorization Code + PKCE in Vanilla JS
<html>
<title>OAuth Authorization Code + PKCE in Vanilla JS</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<!--
MIT License
Copyright (c) 2019 Aaron Parecki
Permission is hereby granted, free of charge, to any person obtaining a copy
@ahmetgeymen
ahmetgeymen / bitbucket-pipelines.yml
Last active October 29, 2023 11:11
Bitbucket Pipelines: Build Docker Image + GCR Image Push + GKE Deploy
image: openjdk:11-jdk-slim
definitions:
caches:
gradlewrapper: ~/.gradle/wrapper
gke-kubectl-pipe: &pipe atlassian/google-gke-kubectl-run:1.3.1
gke-kubectl-pipe-variables: &pipe-variables
KEY_FILE: $GKE_API_KEYFILE
PROJECT: $GCP_PROJECT_ID
COMPUTE_ZONE: $GKE_COMPUTE_ZONE
@ahmetgeymen
ahmetgeymen / bitbucket-pipelines.yml
Last active August 13, 2020 22:15
Bitbucket Pipelines: Build Docker Image + GCP Image Push || AWS Image Push
image: openjdk:11-jdk-slim
definitions:
caches:
gradlewrapper: ~/.gradle/wrapper
steps:
- step: &lint
name: Lint
caches:
- gradle
@ahmetgeymen
ahmetgeymen / UIImage+Color.swift
Last active September 19, 2017 17:36
Extension to UIImage which returns an image filled with given solid color and given size.
import UIKit
extension UIImage {
static func imageWithColor(color: UIColor, size: CGSize = CGSize(width: 1, height: 1)) -> UIImage? {
UIGraphicsBeginImageContext(size)
if let context = UIGraphicsGetCurrentContext() {
context.setFillColor(color.cgColor)
context.fill(CGRect(origin: .zero, size: size))
@ahmetgeymen
ahmetgeymen / UIColor+HexString.swift
Last active November 30, 2017 07:34
UIColor initialise with hexadecimal string like "#ABCDEF"
import UIKit
extension UIColor {
convenience init(hexaString: String, alpha: CGFloat = 1) {
let chars = Array(hexaString)
self.init(red: CGFloat(strtoul(String(chars[1...2]), nil, 16))/255,
green: CGFloat(strtoul(String(chars[3...4]), nil, 16))/255,
blue: CGFloat(strtoul(String(chars[5...6]), nil, 16))/255,
alpha: alpha)