Skip to content

Instantly share code, notes, and snippets.

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

Savaş Can ALTUN saltun

🏠
Working from home
View GitHub Profile
@saltun
saltun / example.html
Last active January 27, 2022 07:01
Select All Checkboxes with jQuery example
<!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 22:05
Türkiyede Bulunan Bankaların Listesi / PHP Türkiye de ki banka listesi dizini
<?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 November 29, 2019 00:40
HTML No Print Element
<!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 12:44
PHP Strong unique api key generator
<?php
echo bin2hex(random_bytes(20)); // int type
// return 4b5ffb1b86049479d7bc875bcaf0a9b4fcfd1b16
1c349abe3d2ee7889fc44dff28dfbb2bff25376910f75615cff9d180f2014f6cf46fa21a79a2
@saltun
saltun / cutnumber.js
Created December 19, 2017 23:33
JavaScript cut number
// 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 July 14, 2016 17:28
PHPDOC Example Class
<?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 March 27, 2021 18:21
PHP Google reCaptcha Examples
<?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";
@saltun
saltun / php-create-random-date.php
Created June 12, 2016 22:56
PHP Create Random Date
<?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 December 9, 2015 16:10
Laravel 5 Validation Türkçe
<?php
/* Translate Savaş Can ALTUN < savascanaltun@gmail.com > */
return [
/*
|--------------------------------------------------------------------------
| Validation Language Lines
|--------------------------------------------------------------------------
|
| The following language lines contain the default error messages used by