This file contains hidden or 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 PIL import Image | |
class ThumbNail(object): | |
""" | |
init function for base Class | |
Parameters | |
------------ | |
targetFile: |
This file contains hidden or 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
# mirat'in kodu | |
# <proje>/scripts/stats.py | |
import glob | |
import os | |
SCAN_FOLDER = "../" | |
stats = { | |
"python" : 0, |
This file contains hidden or 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 | |
$a[] = array( | |
"name" => "emre", | |
"price" => 99, | |
); | |
$a[] = array( | |
"name" => "ali", | |
"price" => 15, |
This file contains hidden or 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/python | |
# -*- coding: utf-8 -*- | |
import os | |
from distutils.sysconfig import get_python_lib | |
class Installer(object): | |
def __init__(self): | |
self.__controlUser() |
This file contains hidden or 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
class ThumbnailTools(object): | |
@staticmethod | |
def get_thumb_info(file): | |
reply = re.search("(.*?)\.([a-zA-Z]{3,4})$", file) | |
return (reply.group(1), reply.group(2)) | |
@staticmethod | |
def get_thumb_name(file, thumb_type): | |
file_info = ThumbnailTools.get_thumb_info(file) |
This file contains hidden or 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
# -*- coding: utf8 -*- | |
import hashlib | |
class FacebookApiSessionValidatorException(Exception): | |
pass | |
class FacebookApiSessionValidator(object): | |
def __init__(self, application_secret, session): |
This file contains hidden or 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
import solr | |
# create a connection to a solr server | |
s = solr.SolrConnection('http://foo/bar/:8180/solr') | |
# get all documents | |
response = s.query('*:*') | |
for hit in response.results: | |
s.delete(hit['id']) | |
s.commit() |
This file contains hidden or 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
# -*- coding: utf8 -*- | |
import urllib, simplejson | |
class GoogleMapsWrapper(object): | |
def __init__(self, apiKey): | |
self.api_key = apiKey | |
def search(self, address): | |
""" |
This file contains hidden or 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 ProxyRouterException extends Exception {} | |
class ProxyRouter { | |
public $url; | |
public function __construct($url) { | |
$this->url = $this->_control_url($url); |
This file contains hidden or 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
# [your-project/context_processors.py] | |
from django.conf import settings | |
def ssl_fix(request): | |
media_url = getattr(settings, 'MEDIA_URL') | |
if request.is_secure() == True: | |
media_url = media_url.replace("http://", "https://") | |
return { | |
"MEDIA_URL": media_url, |
OlderNewer