Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Savaş Can ALTUN saltun

🏠
Working from home
View GitHub Profile
@saltun
saltun / example.html
Last active Jan 27, 2022
Select All Checkboxes with jQuery example
View example.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Select All Checkboxes with jQuery - savascanaltun.com.tr</title>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
</head>
<body>
<center>
@saltun
saltun / list.php
Created May 30, 2020
Türkiyede Bulunan Bankaların Listesi / PHP Türkiye de ki banka listesi dizini
View list.php
<?php
/** Turkey Bank list
* @date 31.05.2020
*/
$array=[
0 => 'Adabank A.Ş. ',
1 => 'Akbank T.A.Ş. ',
2 => 'Aktif Yatırım Bankası A.Ş. ',
3 => 'Alternatifbank A.Ş. ',
4 => 'Anadolubank A.Ş. ',
@saltun
saltun / no-print-element.html
Last active Nov 29, 2019
HTML No Print Element
View no-print-element.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test Page - Savaş Can ALTUN / savascanaltun.com.tr</title>
<style type="text/css">
@media print{
.no-print, .no-print *
{
display: none !important;
@saltun
saltun / phpApikeyGenerator.php
Created May 17, 2019
PHP Strong unique api key generator
View phpApikeyGenerator.php
<?php
echo bin2hex(random_bytes(20)); // int type
// return 4b5ffb1b86049479d7bc875bcaf0a9b4fcfd1b16
View gist:2da1da866e446675e85652b81fce8a7b
1c349abe3d2ee7889fc44dff28dfbb2bff25376910f75615cff9d180f2014f6cf46fa21a79a2
@saltun
saltun / cutnumber.js
Created Dec 19, 2017
JavaScript cut number
View cutnumber.js
// Turkish
function cutNumber(value) {
var newValue = value;
if (value >= 1000) {
var suffixes = ["", "Bin", "Milyon", "Milyar"," Trilyon"];
var suffixNum = Math.floor( (""+value).length/3 );
var shortValue = '';
for (var precision = 2; precision >= 1; precision--) {
shortValue = parseFloat( (suffixNum != 0 ? (value / Math.pow(1000,suffixNum) ) : value).toPrecision(precision));
var dotLessShortValue = (shortValue + '').replace(/[^a-zA-Z 0-9]+/g,'');
@saltun
saltun / phpdoc.php
Last active Jul 14, 2016
PHPDOC Example Class
View phpdoc.php
<?php
/**
* İnsan sınıfı x)
* @author Savaş Can ALTUN <savascanaltun@gmail.com>
* @link http://savascanaltun.com.tr
* @version 1.0
*/
class Human {
@saltun
saltun / recaptcha.php
Last active Mar 27, 2021
PHP Google reCaptcha Examples
View recaptcha.php
<?php
if ($_POST) {
/*
* Author : Savaş Can ALTUN <savascanaltun@gmail.com>
* Date : 28.06.2016
* Personel Page => http://savascanaltun.com.tr
* Video Example => https://www.youtube.com/watch?v=7F-vWQjbeMo
*/
$url="https://www.google.com/recaptcha/api/siteverify";
View php-create-random-date.php
<?php
/**
* @author Savaş Can ALTUn <savascanaltun@gmail.com>
* www.savascanaltun.com.tr
*/
$tarihBas = strtotime('1.1.2016'); // date Start
$tarihSon = strtotime('24.06.2016'); // date End
$rastgeleTarih = rand($tarihBas, $tarihSon); // create random
echo(date('d.m.Y H:i', $rastgeleTarih)); // convert time
@saltun
saltun / validation.php
Created Dec 9, 2015
Laravel 5 Validation Türkçe
View validation.php
<?php
/* Translate Savaş Can ALTUN < savascanaltun@gmail.com > */
return [
/*
|--------------------------------------------------------------------------
| Validation Language Lines
|--------------------------------------------------------------------------
|
| The following language lines contain the default error messages used by