Skip to content

Instantly share code, notes, and snippets.

View mucahitnezir's full-sized avatar
🎯
Focusing

Mücahit Nezir mucahitnezir

🎯
Focusing
View GitHub Profile
@mucahitnezir
mucahitnezir / chrome-theme-color.html
Last active April 11, 2017 14:23
chrome browser theme color
<head>
<meta name="theme-color" content="#007cc5">
</head>
@mucahitnezir
mucahitnezir / responsive-web-design.css
Last active April 20, 2023 07:36
width ranges for responsive web design
/* This width range is for smartphone (tr: akıllı telefonlar için) */
@media (max-width: 767px) {
.container { width: auto; }
/* your other css codes */
}
/* This width range is for tablet (tr: tabletler için) */
@media (min-width: 768px) and (max-width: 991px) {
.container { width: 730px; }
/* your other css codes */
@mucahitnezir
mucahitnezir / app.js
Created April 11, 2017 14:04
Node.js app.listen() method to connect different devices in the same network
app.listen(8080, "0.0.0.0", function(){
console.log("Your app is ready at 8080 port.");
});
@mucahitnezir
mucahitnezir / .htaccess
Last active April 11, 2017 14:11
.htaccess commands for www redirect if url doesn't have www subdomain
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursitename\.com [NC]
RewriteRule ^(.*)$ http://www.yoursitename.com/$1 [L,R=301]
@mucahitnezir
mucahitnezir / .htaccess
Last active April 30, 2017 10:18
.htaccess commands for no-www redirect if url has www subdomain
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.yoursitename\.com [NC]
RewriteRule ^(.*)$ http://yoursitename.com/$1 [L,R=301]
@mucahitnezir
mucahitnezir / turkish-google-font.css
Last active April 25, 2023 08:15
Google font turkish character problem solution
/*
Example Font : Rajdhani
Normal Url : https://fonts.googleapis.com/css?family=Rajdhani:400,300,500,700,600
with Adding ext : https://fonts.googleapis.com/css?family=Rajdhani:400,300,500,700,600&subset=latin,latin-ext
*/
/* import font */
@import url(https://fonts.googleapis.com/css?family=Rajdhani:400,300,500,700,600&subset=latin,latin-ext);
/* Usage of font */
@mucahitnezir
mucahitnezir / image-preview.html
Last active April 16, 2017 16:02
You can show selected images via javascript without upload.
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Image Previews without upload</title>
<style type="text/css">
#pictures { width: 1000px; height: auto; margin: 40px auto; padding: 20px; }
#pictures img { vertical-align: middle; width: 235px; height: auto; float: left; margin-right: 20px; margin-bottom: 20px; }
#pictures img:nth-child(4n) { margin-right: 0px; }
</style>
@mucahitnezir
mucahitnezir / .htaccess
Created May 10, 2017 19:10
.htaccess commands for ssl redirection (http to https)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
@mucahitnezir
mucahitnezir / functions.php
Last active July 18, 2019 12:58
Googe Tag Manager integration for wordpress websites. Replace your GTM code with YOUR-GTM-CODE in functions.php. Copy the contents of these files to active wordpress theme in your wordpress website.
<?php
/* Google Tag Manager Code For Head Tag */
add_action('wp_head', 'wp_head_tag_manager');
function wp_head_tag_manager()
{
?>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
@mucahitnezir
mucahitnezir / .htaccess
Last active August 21, 2023 01:11
General .htaccess file for gzip/deflate compression and redirecting both of www and ssl(https). Needed modules in httpd.conf: deflate_module(modules/mod_deflate.so), (expires_module modules/mod_expires.so), (headers_module modules/mod_headers.so), (rewrite_module modules/mod_rewrite.so)
## KEEP-ALIVE ##
<IfModule mod_headers.c>
Header set Connection keep-alive
</IfModule>
## KEEP-ALIVE ##
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 month"