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 | |
| // Given any image url, it uploads to amazon s3 | |
| function UploadImageURL() | |
| { | |
| // $image_url = (isset($_REQUEST["image_url"]) && $_REQUEST["image_url"]!=null) ? $_REQUEST["image_url"] : null; | |
| $image_url = "https://fbcdn-sphotos-a-a.akamaihd.net/hphotos-ak-prn1/t1/p526x296/1965014_10153859707455111_1422873058_n.jpg"; | |
| // $image_url = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIWFRQBAwQEBgUGCgYGChAODA0QFA8OEAwNDQ8QDw0ODhANEA8MDA8PDxAQFA4VDw8PDhANDQ4ODRAQDw8UDhAMDA0MDP/AABEIACwALAMBEQACEQEDEQH/xAAaAAADAAMBAAAAAAAAAAAAAAAHCAkDBQYE/8QANBAAAQMDAwMCAwUJAQAAAAAAAQIDBAUGEQAHIQgSMRNBFCJxFzJCYYEVFiM0Q1FTcpEJ/8QAGgEAAgMBAQAAAAAAAAAAAAAAAwQABQYCAf/EACsRAAEDAwIEBQUBAAAAAAAAAAEAAgMREjEEIRNBUfBxgZGhwQUUImHRsf/aAAwDAQACEQMRAD8AfZtXA0wuFnR51FKrX3jd1N29s2uXRWFqbpVFgvVCUpsZV6baCtQSPdRAwB7kjUUUO7yvW/uszeebcc1Dji1r7I8NtwmPTI/4Gkk8ADyTgFSsnydIT6hkQq4+ATmn0z5zaweJ5BF66+gLcyltQbkiINXSyhC3YkBKlyEYGThJyFeM8YGST76Wh1okdu0jompdAWD8XA9e |
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 | |
| $test_results = array(array('sample' => 'agus', 'subject' => 'dayu', 'confidence' => '5.32442375'), | |
| array('sample' => 'chapman', 'subject' => 'dayu', 'confidence' => '431.866991'), | |
| array('sample' => 'dayu', 'subject' => 'dayu', 'confidence' => '283.407861'), | |
| array('sample' => 'alex', 'subject' => 'dayu', 'confidence' => '455.675758'), | |
| array('sample' => 'ali', 'subject' => 'dayu', 'confidence' => '150.218559'), | |
| array('sample' => 'shayan', 'subject' => 'dayu', 'confidence' => '395.017484'), | |
| array('sample' => 's1', 'subject' => 'dayu', 'confidence' => '92.1327915'), | |
| array('sample' => 's2', 'subject' => 'dayu', 'confidence' => '119.563628'), |
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 django.core.wsgi import get_wsgi_application | |
| from dj_static import Cling | |
| application = Cling(get_wsgi_application()) |
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
| # Parse database configuration from $DATABASE_URL | |
| import dj_database_url | |
| DATABASES['default'] = dj_database_url.config() | |
| # Honor the 'X-Forwarded-Proto' header for request.is_secure() | |
| SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') | |
| # Allow all host headers | |
| ALLOWED_HOSTS = ['*'] |
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 | |
| function Test() | |
| { | |
| $template_engine = TemplateEngine::get(); | |
| $subjects = App::getSubjects(); | |
| $test_results = array(); | |
| foreach($subjects as $subject) |
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
| // Reference: http://www.thecodeship.com/web-development/alternative-to-javascript-evil-setinterval/ | |
| function interval(func, wait, times){ | |
| var interv = function(w, t){ | |
| return function(){ | |
| if(typeof t === "undefined" || t-- > 0){ | |
| setTimeout(interv, w); | |
| try{ | |
| func.call(null); | |
| } |
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
| - Create bitbucket repo | |
| - Researching what to do with the face detection and face recognition stuff, investigating opencv or any API. | |
| - Share repo to team mates | |
| - Create local environment | |
| - Initial push | |
| - Clone git repo in team mates computers | |
| - Create heroku app | |
| - Decided we are going to use Sky Biometry API for the face detection and face recognition part | |
| - Decided we are going to use php for the backend and lot of javascript for the frontend |
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
| git diff --diff-filter=D --name-only -z | xargs -0 git rm |
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
| var collection_helper = (function () { | |
| var collection = [], | |
| $collection = $(collection), | |
| inCollection = function (item) { | |
| //debugger; | |
| var index = -1, | |
| iterator = 0, | |
| total_iterator = $collection.length; | |
| for (iterator; iterator < total_iterator; iterator++) { |
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
| function makeid(length) | |
| { | |
| var text = ""; | |
| var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |
| for(var i=0; i < length; i++) | |
| { | |
| text += possible.charAt(Math.floor(Math.random() * possible.length)); | |
| } |