Skip to content

Instantly share code, notes, and snippets.

View hasantayyar's full-sized avatar
⌨️
AFK

Hasan Tayyar Beşik hasantayyar

⌨️
AFK
View GitHub Profile
@hasantayyar
hasantayyar / GIF-Screencast-OSX.md
Created March 27, 2016 09:21 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.9.deb
sudo dpkg -i elasticsearch-0.90.9.deb
@hasantayyar
hasantayyar / validations.js
Last active January 4, 2016 05:49 — forked from przemoc/validations.rb
iban,issn,isbn validations js
var validations = {
iban : function(str){
//International Bank Account Number
if(!str.match(/[A-Z]{2}\d{2} ?[A-Z\d]{4}( ?\d{4}){1,} ?\d{1,4}/)) {
return false;
}
},
isbn : function(str){
// implement
},
#!/bin/bash
#update-java
PROG_VERSION='java-update_v0.5beta'; #spaces not allowed
HELP='Easy way to maintain default Java version in $PATH';
#Copyright 2010, Bruce Ingalls GPL 3 Affero see http://www.gnu.org/ for details
#Downloads & discussion at http://www.webupd8.org/
#Contact bingalls at users dot sf dot net for licensing & additional help
#Currently supports Ubuntu, only. Likely less useful for RPM based Linux distros.
#Currently supports only full java jdk, not jre.
/*
* İl : 81
* İlçe : 957
*
* */
var city = new Array('Adana', 'Adıyaman', 'Afyonkarahisar', 'Ağrı', 'Amasya', 'Ankara', 'Antalya', 'Artvin', 'Aydın', 'Balıkesir', 'Bilecik', 'Bingöl', 'Bitlis', 'Bolu', 'Burdur', 'Bursa', 'Çanakkale', 'Çankırı', 'Çorum', 'Denizli', 'Diyarbakır', 'Edirne', 'Elazığ', 'Erzincan', 'Erzurum', 'Eskişehir', 'Gaziantep', 'Giresun', 'Gümüşhane', 'Hakkâri', 'Hatay', 'Isparta', 'Mersin', 'İstanbul', 'İzmir', 'Kars', 'Kastamonu', 'Kayseri', 'Kırklareli', 'Kırşehir', 'Kocaeli', 'Konya', 'Kütahya', 'Malatya', 'Manisa', 'Kahramanmaraş', 'Mardin', 'Muğla', 'Muş', 'Nevşehir', 'Niğde', 'Ordu', 'Rize', 'Sakarya', 'Samsun', 'Siirt', 'Sinop', 'Sivas', 'Tekirdağ', 'Tokat', 'Trabzon', 'Tunceli', 'Şanlıurfa', 'Uşak', 'Van', 'Yozgat', 'Zonguldak', 'Aksaray', 'Bayburt', 'Karaman', 'Kırıkkale', 'Batman', 'Şırnak', 'Bartın', 'Ardahan', 'Iğdır', 'Yalova', 'Karabük', 'Kilis', 'Osmaniye', 'Düzce');
var phone_code = new Array('0322', '0416', '0272', '0472', '0358', '0312', '0242', '0
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');
@hasantayyar
hasantayyar / README.md
Last active January 1, 2016 07:39 — forked from oodavid/README.md

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
<?php
function get_ip_address() {
$ip_keys = array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR');
foreach ($ip_keys as $key) {
if (array_key_exists($key, $_SERVER) === true) {
foreach (explode(',', $_SERVER[$key]) as $ip) {
// trim for safety measures
$ip = trim($ip);
// attempt to validate IP
if (validate_ip($ip)) {
CREATE TABLE `isimler` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`ad` varchar(255) COLLATE utf8_bin NOT NULL,
`cinsiyet` varchar(50) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `ad` (`ad`),
KEY `cinsiyet` (`cinsiyet`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;