# Force to use https
server {
listen 80;
listen [::]:80;
server_name example.com;
return 301 https://$server_name$request_uri;
}
# Default server configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.utils.functional import curry | |
class DetailsInline(admin.TabularInline): | |
model = Details | |
# formset = DetailsFormset | |
extra = 3 | |
def get_formset(self, request, obj=None, **kwargs): | |
initial = [] | |
if request.method == "GET": |

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
layout: null | |
permalink: robots.txt | |
--- | |
# filter pages and documents for the noindex key | |
{% assign noindexPages = site.pages | where: 'sitemap', false %} | |
{% assign noindexDocuments = site.documents | where: 'sitemap', false %} | |
User-agent: * | |
# robotstxt.org - if _config production variable is false robots will be disallowed. | |
{% if site.production != true %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @brief | |
# Performs file upload validation for django. The original version implemented | |
# by dokterbob had some problems with determining the correct mimetype and | |
# determining the size of the file uploaded (at least within my Django application | |
# that is). | |
# @author dokterbob | |
# @author jrosebr1 | |
import mimetypes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Bahceli { | |
function __call($name, $args) { | |
if (preg_match('/yak|dov/i', $name)) { | |
return true; | |
} else { | |
return false; | |
} | |
} |
Here are a few example use cases, these use cases combine filter with other parameters to make useful API queries. The syntax for any of this may change between now, implementation, and release - they're meant as illustrative examples :)
api.posts.browse({filter: "tags:[photo, video] + id:-5", limit="3"});
GET /api/posts?filter=tags%3A%5Bphoto%2Cvideo%5D%2Bid%3A-5&limit=3
Selamlar,
İstanbul PHP kullanıcı grubu olarak, 25/26 Temmuz tarihlerinde düzenliyoruz olduğumuz İstanbul PHP Konferansı için öğrenci arkadaşlarımıza $15 değerinde standart bileti ücretsiz dağıtmak istiyoruz.
Sizlerden beklentimiz ise (Aşağıdaki maddelerde sadece 10 Temmuz tarihi itibarıyla yaptığınız katkılar geçerlidir):
- Açık kaynak bir projenin bir issue'na commit atmak(Bugfix/Improvements vb.).
- Açık kaynak bir projenin Türkçe çevirisine katkıda bulunmak.
- Min. 300 kelime PHP ile ilgili Türkçe blog yazısı yazmak.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python2 | |
import cv2 | |
import numpy as np | |
colors = [] | |
def on_mouse_click (event, x, y, flags, frame): | |
if event == cv2.EVENT_LBUTTONUP: | |
colors.append(frame[y,x].tolist()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Select database based on URL variable | |
Inspired by this Django snipped: | |
https://djangosnippets.org/snippets/2037/ | |
It's assumed that any view in the system with a cfg keyword argument passed to | |
it from the urlconf may be routed to a separate database. for example: |
NewerOlder