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
@ziadoz
ziadoz / awesome-php.md
Last active May 10, 2024 15:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@oodavid
oodavid / README.md
Last active April 6, 2024 18:45 — forked from aronwoost/README.md
Deploy your site with git

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/
@nulltask
nulltask / trapezoid.js
Created February 15, 2012 12:53
trapezoid image transform with node-canvas
/**
* Trapezoid
* - Image transforming class.
*
* Heavily inspired from:
* http://www.leven.ch/canvas/perspective.html
*/
/**
* Module dependencies.
@kevinSuttle
kevinSuttle / meta-tags.md
Last active May 12, 2024 15:28 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags
@Eric-Guo
Eric-Guo / gist:2011069
Created March 10, 2012 10:20
Sublime Text 2 - Useful Shortcuts (Windows 7 CHS)

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands used most towards the top. Sublime also offer full documentation.

Editing

Ctrl+⇧+K delete line
Ctrl+↩ insert line after
Ctrl+⇧+↩ insert line before
Ctrl+⇧+↑ move line (or selection) up
@cballou
cballou / get-ip-address-optimized.php
Created March 26, 2012 00:51
PHP - Advanced Method to Retrieve Client IP Address
<?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)) {
@ajdavis
ajdavis / connection_test.py
Created March 27, 2012 03:23
Testing connection behavior in PyMongo
import os
import shutil
import threading
import sys
import time
import pymongo
import re
# Two steps: 1. run the test. 2. parse the log.
@hasantayyar
hasantayyar / countembeded.js
Created March 27, 2012 08:22
mongodb count embeded objects by an atrribute
var map = function() { emit(this.e, { notifications : this.notifications});};
var reduce = function(key, values) {
var count = 0;
values.forEach(function(docs) {
for(var doc in docs.notifications){
if(docs.notifications[doc].date>1332836355){
count+=1;
}
}
@hasantayyar
hasantayyar / disposablemails.php
Created April 17, 2012 07:35
my disposable email list to prevent abusing
<?php
// has also some orther sites that is not a disposable mail service
$disposalbe = array(
'veryrealemail.com', // mirror of mailinator
'rtrtr.com',
'bobmail.info',
'tradermail.info', // mirror of mailinator
'omurtlak.com',
'mp3dinleq.com', // top spammer
@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');