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 argparse | |
import sys | |
from googleapiclient import sample_tools | |
from pprint import pprint | |
def execute_request(service, property_uri, request): | |
"""Executes a searchAnalytics.query request. | |
Args: | |
service: The webmasters service to use when executing the query. |
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 httplib2 | |
from apiclient import errors | |
from apiclient.discovery import build | |
from oauth2client.client import OAuth2WebServerFlow | |
from googleapiclient import sample_tools | |
# Copy your credentials from the console | |
CLIENT_ID = '76812769011-64bu4bg3bj7o372k4pnpgpjfekuh97mc.apps.googleusercontent.com' |
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
<form> | |
<div class="alert alert-block alert-danger"> | |
<ul> | |
<li>The username and/or password you specified are not correct.</li> | |
</ul> | |
</div> | |
<div class="form-group"> | |
<label for="exampleInputEmail1">Email address</label> | |
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email"> | |
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small> |
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
//Based on gulpfile.js from Google Web Starter Kit. | |
//https://github.com/google/web-starter-kit | |
'use strict'; | |
// Include Gulp & Tools We'll Use | |
var gulp = require('gulp'); | |
var $ = require('gulp-load-plugins')(); | |
var del = require('del'); | |
var runSequence = require('run-sequence'); | |
var browserSync = require('browser-sync'); |
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 random | |
import requests | |
from pprint import pprint | |
users = [] | |
def get_user_data(): | |
response = requests.get('https://randomuser.me/api/') | |
json_respomse = response.json() |
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
def decorator(func, *args, **kwargs): | |
def apply(*args, **kwargs): | |
func(*args, **kwargs) | |
return True | |
def apply_async(*args, **kwargs): | |
func(*args, **kwargs) | |
return 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
class Counter(object): | |
"""docstring for Counter""" | |
def __init__(self, members, multiplier, amount=1): | |
super(Counter, self).__init__() | |
self.members = members | |
self.multiplier = multiplier | |
def __reprt__(self): | |
return 'members in queue: {}, outgoing members: {}'.format(self.members_in_queue, | |
self.outgoing_count) |
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: utf-8 -*- | |
from django.contrib.auth.decorators import login_required | |
from django.utils.cache import patch_response_headers | |
from django.utils.decorators import method_decorator | |
from django.views.decorators.cache import cache_page, never_cache | |
from django.views.decorators.csrf import csrf_exempt | |
class NeverCacheMixin(object): | |
@method_decorator(never_cache) |
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
# sample implementation for http://stackoverflow.com/questions/37851053/django-query-group-by-month#new-answer | |
from __future__ import unicode_literals | |
from django.db import models | |
from django.db.models import Func, F, Sum | |
from django.db.transaction import atomic, rollback | |
from django.utils.timezone import now | |
class Invoice(models.Model): |
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
0x16bDd33A3541cd1f42F54f6d37EDB769842f1502 |