Skip to content

Instantly share code, notes, and snippets.

View berkbatuhans's full-sized avatar
🏠
Evden çalışmak

Berk Batuhan ŞAKAR berkbatuhans

🏠
Evden çalışmak
View GitHub Profile
@cabecada
cabecada / gist:da8913830960a644755b18a02b65e184
Last active January 14, 2025 16:00
python postgres connection with retry example
#!/usr/bin/env python
#https://github.com/psycopg/psycopg2/issues/261
import psycopg2
ISOLEVEL = psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT
import time
import 'dart:async';
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
Future<List<Result>> fetchResults(http.Client client) async {
final response = await client.get('https://api.myjson.com/bins/j5xau');
// popModal() support for Navigator
// https://github.com/flutter/flutter/issues/16677
// If app pushes a new route from a modal route (such as full screen
// dialog), closing the modal starts all exit animations at the same
// time leading to an odd transition.
//
// Expected behavior is for the close action to execute a single modal
// exit animation and apply this animation only on the last route
// visible. In the example above, the secondary route would disappear
@b-cancel
b-cancel / main.dart
Last active November 29, 2021 19:41
FLUTTER => Overriding Back Button in Flutter
import 'package:flutter/material.dart';
import 'dart:async';
void main() => runApp(new BackButtonOverrideDemoWidget());
class BackButtonOverrideDemoWidget extends StatefulWidget{
@override
_BackButtonOverrideDemoWidgetState createState() => new _BackButtonOverrideDemoWidgetState();
}
@zealott
zealott / Controller.cs
Created October 30, 2017 21:30
Form Data Write to File via FTP
public class CustomFormController : CMSPageDefaultController
{
[HttpPost]
public ActionResult FormSubmit(FormCollection collection)
{
try
{
//set our string builder
var csv = new StringBuilder();
//get our form elements
@Gurdeep0602
Gurdeep0602 / AppStoryboard.swift
Last active April 2, 2024 09:54
AppStoryboard enumeration
//
// AppStoryboards.swift
// AppStoryboards
//
// Created by Gurdeep on 15/12/16.
// Copyright © 2016 Gurdeep. All rights reserved.
//
import Foundation
import UIKit
@serkanince
serkanince / TR Banka Bin List
Last active July 24, 2020 13:07
TR Banka Bin Listesi
SET NAMES utf8;
DROP TABLE IF EXISTS `cc_bins`;
CREATE TABLE `cc_bins` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`bank_code` int(11) NOT NULL,
`bank_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`bin_number` int(11) NOT NULL,
`card_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
@erdimeola
erdimeola / est3d.py
Last active September 1, 2023 18:25
Python - EST 3D Secure Integration
#!/usr/bin/python
# -*- coding: utf-8 -*-
from django.shortcuts import redirect
from django.http import HttpResponse
import requests, hashlib, base64, time
EST_MERCHANT_ID = "400000200"
EST_3D_KEY = "TRPS0200"
EST_RETURN_URL = "http://test.domain.com/basarili"
EST_FAIL_URL = "http://test.domain.com/basarisiz"
@lu911
lu911 / mixins.py
Created December 13, 2014 17:52
SQLAlchemy Mixins
# -*- coding:utf-8 -*-
from flask import abort
from datetime import datetime
from project.ext import db
class IdMixin(object):
"""
Provides the :attr:`id` primary key column
@mageframe
mageframe / Chromium Mobile Device List
Created December 3, 2014 06:01
Mobile Device Emulation List from Chromium
#Pulled from Chromium at: https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/devtools/front_end/toolbox/OverridesUI.js&q=WebInspector.OverridesUI._phones%20file:OverridesUI.js&sq=package:chromium&type=cs&l=310
#Phones
Define_phones = [
{deviceName: "Apple iPhone 3GS", width: 320, height: 480, deviceScaleFactor: 1, userAgent: "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5", touch: true, mobile: true},
{deviceName: "Apple iPhone 4", width: 320, height: 480, deviceScaleFactor: 2, userAgent: "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5", touch: true, mobile: true},
{deviceName: "Apple iPhone 5", width: 320, height: 568, deviceScaleFactor: 2, userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Versi