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
import uuid | |
from datetime import datetime | |
import boto3 | |
from django.conf import settings | |
from mypy_boto3_s3 import S3Client | |
from rest_framework import serializers | |
from rest_framework.response import Response | |
from myproject.models import ProfilePhoto |
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 typing import Any, Dict, List, Optional | |
from OpenSSL import crypto | |
import jwt | |
from jwt.utils import base64url_decode | |
import requests | |
import logging | |
ROOT_CER_URL = "https://www.apple.com/certificateauthority/AppleRootCA-G3.cer" | |
G6_CER_URL = "https://www.apple.com/certificateauthority/AppleWWDRCAG6.cer" |
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
SAFARI 10.0.1 | |
Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/14A403 Safari/602.1 | |
CHROME on 10.0.1 | |
Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_1 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/53.0.2785.86 Mobile/14A403 Safari/601.1.46 | |
FACEBOOK MESSENGER | |
Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Mobile/14A403 [FBAN/MessengerForiOS;FBAV/87.0.0.24.69;FBBV/38293694;FBRV/0;FBDV/iPhone8,4;FBMD/iPhone;FBSN/iPhone OS;FBSV/10.0.1;FBSS/2;FBCR/AT&T;FBID/phone;FBLC/en_US;FBOP/5] | |
TWITTER FOR IPHONE |
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
# tested with celery[redis]==3.1.17 | |
# to run with default configuration -- tasks will take 14 seconds to complete the 20 tasks in start_all() below | |
celery worker -A cluster_project.celery_app -Q tester -lINFO --concurrency=4 | |
# to run with -Ofair -- tasks will take 10 seconds to complete | |
celery worker -A cluster_project.celery_app -Q tester -lINFO --concurrency=4 -Ofair |
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
[self.apiClient retrieveConnectedServicesWithSuccessBlock:^(NSDictionary *services) { | |
NSArray *facebookTokens = services[@"facebook"]; | |
if (facebookTokens.count == 0) { | |
return; | |
} | |
NSDictionary *mostRecentFacebookTokenDict = facebookTokens[0]; | |
NSNumber *refreshTimeNumber = mostRecentFacebookTokenDict[@"refreshTime"]; | |
NSDate *refreshDate = [NSDate dateWithTimeIntervalSince1970:[refreshTimeNumber doubleValue]]; |
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
// | |
// ImgixURL.h | |
// Cluster | |
// | |
// Created by Taylor Hughes on 12/18/12. | |
// Copyright (c) 2012 Taylor Hughes. All rights reserved. | |
// | |
#import "NSDictionary+FormEncoded.h" |
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
func EncodeStreamingVideo(streamingFile io.Reader, request ShouldCanceler) (*os.File, error) { | |
outputFilename := generateFilename("mp4") | |
// Actually start the command. | |
cmd := exec.Command("ffmpeg", | |
// Read input from stdin. | |
"-i", "-", | |
// ... environment-specific ffmpeg options ... | |
"-y", outputFilename) |
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
### Keybase proof | |
I hereby claim: | |
* I am taylorhughes on github. | |
* I am taylorhughes (https://keybase.io/taylorhughes) on keybase. | |
* I have a public key whose fingerprint is 7D46 ECF4 DADE BBED 1540 9C79 F40B 2664 6BE8 555D | |
To claim this, I am signing this object: |
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
package main | |
import ( | |
"log" | |
"net/http" | |
"net/http/httputil" | |
"net/url" | |
"os" | |
) |
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
define(['cluster/util'], function(util) { | |
var PubSub = function() { | |
this.listeners_ = []; | |
this.listenersById_ = {}; | |
this.lastId_ = 0; | |
}; | |
NewerOlder