Skip to content

Instantly share code, notes, and snippets.

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

ismail BASKIN ismailbaskin

🏠
Working from home
View GitHub Profile
@ismailbaskin
ismailbaskin / turkce_isimler.sql
Last active May 11, 2024 07:47
Türkçe isim veritabanı
-- Turkce isimler sozlugu twitter : http://twitter.com/baskindev
CREATE TABLE `isimler` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isimler` varchar(255) DEFAULT NULL,
`cinsiyet` varchar(255) DEFAULT NULL COMMENT 'erkek : E , kadın : K , uniseks : U',
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
-- ----------------------------
@ismailbaskin
ismailbaskin / nonAlphaJs.js
Created November 18, 2011 07:35
Magic code
_=[]|[];$=_++;__=(_<<_);___=(_<<_)+_;____=__+__;_____=__+___;$$=({}+"")[_____]+({}+"")[_]+({}[$]+"")[_]+(($!=$)+"")[___]+(($==$)+"")[$]+(($==$)+"")[_]+(($==$)+"")[__]+({}+"")[_____]+(($==$)+"")[$]+({}+"")[_]+(($==$)+"")[_];$$$=(($!=$)+"")[_]+(($!=$)+"")[__]+(($==$)+"")[___]+(($==$)+"")[_]+(($==$)+"")[$];$_$=({}+"")[_____]+({}+"")[_]+({}+"")[_]+(($!=$)+"")[__]+({}+"")[__+_____]+({}+"")[_____]+ ({}+"")[_]+({}[$]+"")[__]+(($==$)+"")[___]; ($)[$$][$$]($$$+"('"+$_$+"')")();
@ismailbaskin
ismailbaskin / fullhtml5.js
Created April 8, 2012 12:01
html5 fullscreen api
(function () {
var viewFullScreen = document.getElementById("view-fullscreen");
if (viewFullScreen) {
viewFullScreen.addEventListener("click", function () {
var docElm = document.documentElement;
if (docElm.requestFullscreen) {
docElm.requestFullscreen();
}
else if (docElm.mozRequestFullScreen) {
docElm.mozRequestFullScreen();
@ismailbaskin
ismailbaskin / postakodu.sql
Created April 24, 2012 05:06
İl - İlçe - semt - mahalle - posta kodu veritabanı
This file has been truncated, but you can view the full file.
DROP TABLE IF EXISTS `pk_il`;
CREATE TABLE `pk_il` (
`il_id` int(2) NOT NULL COMMENT 'plaka kodu',
`il_adi` varchar(255) NOT NULL,
PRIMARY KEY (`il_id`),
KEY `il_adi` (`il_adi`) USING BTREE
) ENGINE=MyISAM;
-- ----------------------------
INSERT INTO `pk_il` VALUES ('1', 'ADANA');
@ismailbaskin
ismailbaskin / il_ilce_enlem_boylam.sql
Created April 25, 2012 18:50
Türkiye İl ve İlçelerin enlem boylam bilgileri
/*
Türkiye İl ve İlçelerin enlem boylam bilgileri (dörtgen olarak sınır pozisyonlarıyla birlikte) kaynak : google maps (başarsoft)
twitter : http://twitter.com/tserpico
*/
DROP TABLE IF EXISTS `pk_il`;
CREATE TABLE `pk_il` (
`il_id` int(2) NOT NULL COMMENT 'plaka kodu',
`il_adi` varchar(255) NOT NULL,
`lat` double(20,8) DEFAULT NULL COMMENT 'enlem',
@ismailbaskin
ismailbaskin / is_tor_request.php
Created February 23, 2014 17:02
Detector for TOR user
function isTorRequest() {
$reverse_client_ip = implode('.', array_reverse(explode('.', $_SERVER['REMOTE_ADDR'])));
$reverse_server_ip = implode('.', array_reverse(explode('.', $_SERVER['SERVER_ADDR'])));
$hostname = $reverse_client_ip . "." . $_SERVER['SERVER_PORT'] . "." . $reverse_server_ip . ".ip-port.exitlist.torproject.org";
return gethostbyname($hostname) == "127.0.0.2";
}
print isTorRequest() ? "Yep" : "Nope";
@ismailbaskin
ismailbaskin / preventToPullRefresh.js
Created March 4, 2016 14:39
repress chrome mobile pull to refresh
window.addEventListener('load', function() {
var maybePreventPullToRefresh = false;
var lastTouchY = 0;
document.addEventListener('touchstart', function(e) {
if (e.touches.length != 1) return;
lastTouchY = e.touches[0].clientY;
// Pull-to-refresh will only trigger if the scroll begins when the
// document's Y offset is zero.
maybePreventPullToRefresh = window.pageYOffset == 0;
}, false);
<?php
class PointSorter
{
/** @var SortablePoint[] */
private $points;
/** @var SortablePoint */
private $upperLeftPoint;
/**
* @param SortablePoint[] $points
<?php
class PolylineEncoder
{
public static function decode(string $value, int $precise = 5): array
{
$index = 0;
$points = [];
$lat = 0;
$lng = 0;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.