Skip to content

Instantly share code, notes, and snippets.

View ahmethakanbesel's full-sized avatar

Ahmet Hakan Beşel ahmethakanbesel

View GitHub Profile
@ahmethakanbesel
ahmethakanbesel / titresim.html
Last active September 8, 2017 07:18
Javascript navigator.vibration API Example
<button onclick="titret(1000)">Titret</button>
<button onclick="titret([1000, 200, 1000, 2000, 400]);">Titret (3 defa aralıklı)</button>
<script>
function titret(sure) {
navigator.vibrate(sure);
console.log(sure + "ms");
}
</script>
@ahmethakanbesel
ahmethakanbesel / multi-submit-form.html
Created August 17, 2017 13:01
Separate Form Submit Buttons That Go To Different URLs
<form action="dosya.php">
<input type="submit" value="Gönder">
<input type="submit" value="Gönder 2" formaction="dosya-2.php">
</form>
@ahmethakanbesel
ahmethakanbesel / disable-kbd.js
Created August 3, 2017 09:49
Pure Javascript Disable Key Binds and Keyboard Shortcuts
document.onkeydown = function (e) {
return false;
}
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
const char* ssid = "";
const char* password = "";
const String url = "http://api.ipify.org";
void setup() {
Serial.begin(115200);
Serial.println("");
Serial.print("Bağlanılıyor ");
@ahmethakanbesel
ahmethakanbesel / dosya-sil.php
Created July 3, 2017 11:47
PHP ile eski dosyaları silme (Delete files older than X in PHP)
<?php
/*
* Silinecek dosyaların bulunduğu dizin
*/
$dir = "klasor/dosyalar";
/*
* Dizindeki tüm dosyalara işlem uygulanır
*/
foreach (glob($dir."*") as $file) {
/*
@ahmethakanbesel
ahmethakanbesel / sekme.js
Last active May 20, 2021 23:20
Sekme değişince sayfa başlığını değiştirme (jQuery).
<script type="text/javascript">
var title = document.title;
var alttitle = "Buraya gelir misin lütfen";
window.onblur = function () { document.title = alttitle; };
window.onfocus = function () { document.title = title; };
</script>
@ahmethakanbesel
ahmethakanbesel / speedtest.php
Created February 25, 2017 17:38
PHP İnternet Hız Testi
<?php
for($sayi = 0; $sayi &lt; 5; $sayi++) {
$kb=1024;
echo "aktarılıyor $kb Kb...&lt;!-";
flush();
$time = explode(" ",microtime());
$start = $time[0] + $time[1];
for($x=0;$x&lt;$kb;$x++){
echo str_pad('', 1024, '.');
@ahmethakanbesel
ahmethakanbesel / paylas.php
Created February 12, 2017 13:32
PHP ile Facebook'ta Resim Paylaşma
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://graph.facebook.com/v2.8/me/photos",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",