Skip to content

Instantly share code, notes, and snippets.

View barlas's full-sized avatar

Barlas Apaydin barlas

View GitHub Profile
@barlas
barlas / ready-tr-lower-upper-func.js
Last active January 29, 2024 20:07
javascript - Turkish character lowercase and uppercase functions.
String.prototype.turkishToLower = function(){
var string = this;
var letters = { "İ": "i", "I": "ı", "Ş": "ş", "Ğ": "ğ", "Ü": "ü", "Ö": "ö", "Ç": "ç" };
string = string.replace(/(([İIŞĞÜÇÖ]))/g, function(letter){ return letters[letter]; })
return string.toLowerCase();
}
String.prototype.turkishToUpper = function(){
var string = this;
var letters = { "i": "İ", "ş": "Ş", "ğ": "Ğ", "ü": "Ü", "ö": "Ö", "ç": "Ç", "ı": "I" };
@barlas
barlas / promises-explained.js
Created March 26, 2020 12:04
ASYNC Code evolution in JS/ES => Callbacks => Promise => async/await
/*
Presentation Parts
Take away: aysnc/await uses promises and promises build with callbacks.
ASYNC Code evolution in JS/ES =>
Callbacks => Promise => async/await
SECTION 1
How aysnc/await works?
git reset --hard
branches:
git branch
git checkout -b [branch-name]
git checkout [branch-name]
git branch -D [branch-name]
// setup
- fork repo
@barlas
barlas / python-fast-webserver.txt
Created October 15, 2015 00:12
python-fast-webserver
$ cd related-dir
$ python -m SimpleHTTPServer 8080
@barlas
barlas / php.ini
Created September 9, 2015 12:04
phar enabled
[PHP]
detect_unicode = Off
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@barlas
barlas / httpd.conf
Last active September 9, 2015 11:59
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
<Directory "/Users/username/Sites/">
Options Indexes MultiViews
AllowOverride All
Options +FollowSymLinks
Require all granted
Allow from all
</Directory>
# Settings for user home directories
#
# Required module: mod_authz_core, mod_authz_host, mod_userdir
#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received. Note that you must also set
# the default access control for these directories, as in the example below.
#
UserDir Sites
@barlas
barlas / NewMacConfig.md
Last active August 29, 2015 14:27 — forked from offsky/NewMacConfig.md
Setup new mac for web development (Updated for Yosemite)
@barlas
barlas / ready
Created April 24, 2015 13:14
jQuery - Close tooltip with a click apart from tooltip wrapper.
$(document).click(function(e) {
if( !$(e.target).closest('.tooltip-wrapper').length ) {
if( $('.tooltip').hasClass('active') ) {
$('.tooltip').hide();
}
}
});