Skip to content

Instantly share code, notes, and snippets.

@selahattinunlu
selahattinunlu / Envoy.blade.php
Last active April 3, 2018 13:00
Envoy.blade.php
@servers(['production' => 'user@ipaddress'])
@setup
$repo = 'git@github.com:selahattinunlu/projectname.com.git';
$releaseDir = '/srv/projectname.com/releases';
$storageDir = '/srv/projectname.com/storage';
$appDir = '/srv/projectname.com/current';
$release = 'release_' . date('d-m-Y-His');
@endsetup
@selahattinunlu
selahattinunlu / laravel.js
Last active October 11, 2015 13:18 — forked from JeffreyWay/laravel.js
Want to send a DELETE request when outside of a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. (Requires jQuery, but doesn't have to.)To use, import script, and create a link with the `data-method="DELETE"` attribute.
/*
Add csrf token inside meta tag named "csrf-token":
<meta name="csrf-token" content="{{ csrf_token() }}">
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-confirm="Are you sure?">
*/
@selahattinunlu
selahattinunlu / fullstackradio.py
Created August 2, 2015 15:48
This is a Python script to download all podcasts on fullstackradio.com
from lxml import html
import requests
import sys
class App:
def __init__(self):
self.url = 'http://fullstackradio.com'
page = requests.get(self.url)
page_string = html.fromstring(page.text)
@selahattinunlu
selahattinunlu / jquery.oncssanimationend.js
Created July 3, 2015 19:11
Detecting CSS Animation and Transition End with JavaScript [http://osvaldas.info]
// http://osvaldas.info/detecting-css-animation-transition-end-with-javascript
/*
By Osvaldas Valutis, www.osvaldas.info
Available for use under the MIT License
*/
;( function( $, window, document, undefined )
{
var s = document.body || document.documentElement, s = s.style, prefixAnimation = '', prefixTransition = '';
-- Adminer 4.2.1 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `cities`;
CREATE TABLE `cities` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
@selahattinunlu
selahattinunlu / gist:1361eb51e305ede9b6a9
Last active April 14, 2017 10:36
PayU Ortak Ödeme Sayfasına Yönlendirmek
<div style="display: none;">
<?php
require(public_path() . '/app/libraries/payu/PayuLiveUpdate.class.php');
if ($_SERVER['REMOTE_ADDR'] == '127.0.0.1') {
$liveUpdate = new PayuLu('PAYUDEMO', 'P5@F8*3!m0+?^9s3&u8('); // test için bu hesap bilgilerini kullanabilirsiniz.
$liveUpdate->setTestMode();
} else {
$liveUpdate = new PayuLu('secret','secret'); // Size verilen hesap bilgilerinizi gireceksiniz.
@selahattinunlu
selahattinunlu / gist:e96439d0a1faa588bfea
Created October 9, 2014 08:36
PayuLiveUpdate.class.php
<?php
/* Make sure strlen behaves as intended by setting multibyte function overload to 0 */
ini_set("mbstring.func_overload", 0);
if (ini_get("mbstring.func_overload") > 2) { /* check if mbstring.func_overload is still set to overload strings(2) */
echo "WARNING: mbstring.func_overload is set to overload strings and might cause problems\n";
}
class PayuLu
{
<?php
$cities = array(
"" => "-- SEÇİNİZ --",
"ADANA" => "ADANA",
"ADIYAMAN" => "ADIYAMAN",
"AFYONKARAHİSAR" => "AFYONKARAHİSAR",
"AĞRI" => "AĞRI",
"AMASYA" => "AMASYA",
"ANKARA" => "ANKARA",
@selahattinunlu
selahattinunlu / timer.sh
Created June 30, 2014 16:54
Tinker App Android'e gelene kadar idare edicez :)
#!/bin/bash
countdown()
(
IFS=:
set -- $*
secs=$(( ${1#0} * 3600 + ${2#0} * 60 + ${3#0} ))
while [ $secs -gt 0 ]
do
sleep 1 &