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 requests | |
url = 'https://ets.aeso.ca/' | |
cert_key = ('cert.pem', 'key.pem') | |
headers = {'User-Agent': 'Mozilla/5.0 (IE 11.0; Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C; rv:11.0) like Gecko'} | |
r = requests.get(url, cert=cert_key, verify=False) | |
print r.text |
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
def _client_specific_post_standard_scrub_updates_ccrd(self): | |
kwargs = {'client': self.client, 'infile': self.client_infile.infile} | |
if self.client_infile.commodity in ('E', 'G'): | |
kwargs['commodity'] = self.client_infile.commodity | |
kwargs['rate_plan_type__rate_plan_type_abbrev'] = 'var' | |
kwargs['svc_start_date__isnull'] = False | |
kwargs['svc_start_date__lt'] = F('file_date') | |
# add transaction block | |
service_end_date = self.file_date + datetime.timedelta(months=6) | |
CustomerCountsRaw.objects.filter(**kwargs).update( |
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 re | |
class BufferFileReader(object): | |
def __init__(self, file_path, size): | |
self.last_offset = 0 | |
self.file_path = file_path | |
self.size = size | |
self.fp = open(self.file_path, 'r') |
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
106 fixture = ("/Users/quezadar/projects/b2b-frontend/B2B/src/b2b/tests/" | |
107 "fixtures/initial_data.json") | |
108 cmd = 'manage.py loaddata \'%s\'' % (fixture,) | |
109 s = StringIO.StringIO() | |
110 sys_stdout = sys.stdout | |
111 sys_stderr = sys.stderr | |
112 sys.stdout = s | |
113 sys.stderr = s | |
114 execute_from_command_line(cmd.split(' ')) | |
115 sys.stdout = sys_stdout |
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
31 +class AdminLoginMixin(object): | |
40 32 | |
41 33 def _create_user(self): | |
42 34 self.TEST_USERNAME = 'testusername' | |
43 35 self.TEST_PASSWORD = 'testpassword' | |
44 36 | |
45 37 u, created = auth_models.User.objects.get_or_create( | |
46 38 username=self.TEST_USERNAME) | |
47 39 if created: | |
48 40 u.set_password(self.TEST_PASSWORD) |
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
20 def compact_array(list_, i=0): | |
21 if i == len(list_): | |
22 return [] | |
23 if not list_[i]: | |
24 return [] + compact_array(list_, i + 1) | |
25 return [list_[i]] + compact_array(list_, i + 1) | |
26 | |
27 def flatten_array(flatten): | |
28 def has_array(list_): | |
29 return any((isinstance(li, list) for li in list_)) |
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
converter from UTF-8 to Big5-UAO | |
make[1]: *** [enc/trans/big5.c] Killed | |
make[1]: Leaving directory `/home/rpq/.local/src/ruby' | |
make: *** [srcs-enc] Error 2 |
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
CC = gcc | |
LD = ld | |
LDSHARED = gcc -shared | |
CFLAGS = -O1 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -ansi -std=iso9899:199409 | |
XCFLAGS = -include ruby/config.h -include ruby/missing.h -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -fPIE | |
CPPFLAGS = -I. -I.ext/include/x86_64-linux -I./include -I. | |
DLDFLAGS = -fstack-protector -pie | |
SOLIBS = | |
generating encdb.h | |
encdb.h unchanged |
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
compiling pack.c | |
compiling parse.c | |
gcc: Internal error: Killed (program cc1) | |
Please submit a full bug report. | |
See <http://bugzilla.redhat.com/bugzilla> for instructions. | |
make: *** [parse.o] Error 1 | |
CC = gcc | |
LD = ld | |
LDSHARED = gcc -shared | |
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -ansi -std=iso9899:199409 |
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
3 /** setup spinner on ajax calls **/ | |
4 $.ajaxSetup({ | |
5 headers: { "HTTP_X_REQUESTED_WITH": "XMLHttpRequest" }, | |
6 cache: false, | |
7 error: function() { | |
8 alert('There was an error reaching the server!'); | |
9 }, | |
10 timeout: 10000, | |
11 beforeSend: function() { | |
12 $('#loading-status').show(); |
NewerOlder