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 requests | |
import json | |
api_base_url = 'http://localhost:8000/api/1/' | |
glow_api_token = '2d2e1f3e3d40bca24477929c1e77f8f2419492c4' | |
account_id = '520367d182711919fe02dd52' | |
auth_header = {'Authorization': 'Token ' + glow_api_token} | |
pixel_data = {'pixel_data': {'short_name': 'Segment Pixel Test 001 - Andrea', 'account_id': account_id}} |
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 requests | |
import json | |
class AppNexusClient(object): | |
@staticmethod | |
def authenticate(username, password): | |
auth_data = {'auth': {'username': username, 'password': password}} | |
r = requests.post('https://api.appnexus.com/auth', data = json.dumps(auth_data)) | |
return r.json()['response']['token'] |
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 DisableCSRF(object): | |
def process_request(self, request): | |
setattr(request, '_dont_enforce_csrf_checks', True) |
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
if DEBUG: | |
EMAIL_HOST = 'localhost' | |
EMAIL_PORT = 1025 | |
EMAIL_HOST_USER = '' | |
EMAIL_HOST_PASSWORD = '' | |
EMAIL_USE_TLS = False | |
DEFAULT_FROM_EMAIL = '[email protected]' |
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
color = 'Pink' | |
def refrain_one(): | |
print "%s it was love at first sight " % (color) | |
print "%s when I turn out the light, and " % (color) | |
print "%s gets me high as a kite " % (color) | |
print "And I think everything is going to be all right " | |
print "No matter what we do tonight " | |
print "" |
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
package main | |
import ( | |
"fmt" | |
"encoding/json" | |
) | |
type Message struct { | |
Name string | |
Body string |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"net/http" | |
) | |
type test_struct struct { | |
Test string |
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
package main | |
import ( | |
"flag" | |
"fmt" | |
) | |
var hostName = flag.String("host", "localhost", "Hostname or IP you want to run this service on") | |
var portNumber = flag.Int("port", 8080, "Port you want this service to listen on (default 8080)") |
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
package main | |
import ( | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"strings" | |
) | |
var fileName = flag.String("f", "", "Filename to be read") |
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
package main | |
import ( | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
) | |
var url = flag.String("u", "", "URL to read") |