Skip to content

Instantly share code, notes, and snippets.

View erdemildiz's full-sized avatar
🏠
Working from home

Erdem ILDIZ erdemildiz

🏠
Working from home
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
@erdemildiz
erdemildiz / vscode.setting.json
Created November 2, 2017 08:41
VS Code Settings
{
"editor.minimap.enabled": false,
"editor.fontSize": 13,
"git.enableSmartCommit": true,
"emmet.triggerExpansionOnTab": true,
"editor.renderIndentGuides": true,
"editor.tabSize": 2,
"editor.formatOnSave": true,
"beautify.language": {
"js": {
import React from 'react-native'
var {
Image,
Animated,
View
} = React
module.exports = React.createClass({
getInitialState() {
@erdemildiz
erdemildiz / LocalStorage.swift
Created December 7, 2018 20:33 — forked from KalpeshTalkar/LocalStorage.swift
LocalStorage is an abstraction over the UserDefaults. The class is written in Swift 3
// Copyright © 2017 Kalpesh Talkar. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@erdemildiz
erdemildiz / keyboardproblem.swift
Last active October 9, 2019 07:32
IOS TextField Keyboard Problem on Swift [Swift 4.2.1]
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillChange(notification:)), name: UIResponder.keyboardWillShowNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillChange(notification:)), name: UIResponder.keyboardWillHideNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillChange(notification:)), name: UIResponder.keyboardWillChangeFrameNotification, object: nil)
@erdemildiz
erdemildiz / styles.js
Last active February 14, 2019 08:45
Common styles declares for React Native
import ratio from './ratio';
import colors from './colors';
// FontWeight - Bold
const bold = { fontWeight: 'bold' };
// border bottom - 1, color - lightGray
const borderBottomLightGray = { borderBottomWidth: 1, borderColor: colors.lightGray };
// fontSize
const size10 = { fontSize: ratio.fontScale(10) };
const size11 = { fontSize: ratio.fontScale(11) };
const size12 = { fontSize: ratio.fontScale(12) };
@erdemildiz
erdemildiz / dimentions.js
Last active February 14, 2019 08:46
Common dimentions for React Native
// Padding - 15
const padding15 = { padding: 15 };
const paddingTop15 = { padding: 15 };
const paddingRight15 = { paddingRight: 15 };
const paddingBottom15 = { paddingBottom: 15 };
const paddingLeft15 = { paddingLeft: 15 };
const paddingVeritacal15 = { paddingVertical: 15 };
const paddingHorizontal15 = { paddingHorizontal: 15 };
// Margin - 15
const margin15 = { margin: 15 };
@erdemildiz
erdemildiz / build.gradlew
Created July 22, 2019 19:11
React Native Hermes build.gradlew config
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: "com.android.application"
apply plugin: 'io.fabric'
import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js",
enableHermes: true
@erdemildiz
erdemildiz / duplicate_line_xcode.md
Last active September 26, 2020 16:15 — forked from emotality/duplicate_line_xcode.md
Xcode - Duplicate Line key binding

Xcode line duplicate

Bind keys to duplicate lines in Xcode

  1. Open below directory in Finder with Cmnd + Shift + G
/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/
@erdemildiz
erdemildiz / configure.swift
Last active September 26, 2020 16:15
Self enclosing nice function in swift
func configure<T>(
_ value: T,
using closure: (inout T) throws -> Void
) rethrows -> T {
var value = value
try closure(&value)
return value
}