Skip to content

Instantly share code, notes, and snippets.

View nesimtunc's full-sized avatar
:octocat:

Nesim Tunc nesimtunc

:octocat:
View GitHub Profile
@nesimtunc
nesimtunc / main.dart
Created April 6, 2022 08:51
Reduce Flutter Widget Rebuilding while using Provider
import 'package:flutter/material.dart';
import 'package:letswatch/video_store.dart';
import 'package:provider/provider.dart';
class Video {
String url;
Status status = Status.notReady;
Video(this.url, {this.status = Status.notReady});
@nesimtunc
nesimtunc / CustomNumberFormatter.swift
Created December 30, 2021 05:00
Swift Custom Number Formatter for Currency
import UIKit
struct CurrencyFormatter {
let currencySymbol: String
let customLocale: String
private var customNumberFormatter: NumberFormatter {
let formatter = NumberFormatter()
formatter.locale = Locale.init(identifier: customLocale)
@nesimtunc
nesimtunc / KeychainWrapper.swift
Created October 15, 2020 12:27
A Keychain Wrapper for String Key and Value to save sensitive data in Apple Keychain
import Foundation
import Security
public enum KeychainWrapperError: Error {
case emptyKeyOrValue
case failure(status: OSStatus)
}
class KeychainWrapper {
@nesimtunc
nesimtunc / EYSupportMailComposer.h
Created December 9, 2018 06:35 — forked from erkanyildiz/EYSupportMailComposer.h
Support mail composer with activity indicator
// erkanyildiz
// 20170828-2105+0900
//
// EYSupportMailComposer.h
#import <Foundation/Foundation.h>
@interface EYSupportMailComposer : NSObject
+ (void)presentMailComposerOnViewController:(UIViewController *)viewController withEmail:(NSString *)email;
@nesimtunc
nesimtunc / ImageController.js
Last active July 21, 2024 03:03
Minio Server - NodeJS - File Upload & Photo Showing Example
const formidable = require('formidable');
const fs = require('fs');
var Minio = require('minio');
let minioClient = new Minio.Client({
endPoint: config.MINIO.ENDPOINT,
port: config.MINIO.PORT,
accessKey: config.MINIO.ACCESS_KEY,
@nesimtunc
nesimtunc / messaging.js
Created December 7, 2015 05:08
Communication between HTML DOM elements like iframe in a secure way
// Let's assume you have two separated HTML DOM elements that
// you want to make a secure communication between them
// ex: an iframe inside HTML body
// since cross domain restrictions you may not access the iframe object
// here is how you can manage it (of course if you develop both side)
// This code has been developed regarding this document:
// https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
// Main Page (index.html)