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 itertools | |
def generate_prime(): | |
d = {} | |
for i in itertools.count(2): | |
n = d.pop(i, None) | |
if n: | |
p = n + i | |
while p in d: |
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
<script type="text/javascript" src="/angular/angular.js"></script> | |
<script type="text/javascript" src="/angular/angular-cookies.min.js"></script> | |
// app.js | |
// inject ngCookies to your app named 'myApp'. | |
angular.module('myApp', ['ngCookies']); | |
// controller.js | |
function MyCtrl($scope, $http, $cookies) { |
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 | |
from bs4 import BeautifulSoup as bs | |
def get_login_token(raw_resp): | |
soup = bs(raw_resp.text, 'lxml') | |
token = [n['value'] for n in soup.find_all('input') | |
if n['name'] == 'wpLoginToken'] | |
return token[0] |
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 | |
payload = { | |
'username': 'MY_USERNAME', | |
'password': 'MY_PASSWORD', | |
'login.submit': 'Login' | |
} | |
user_id = 8 # change it to your user_id for testing purpose | |
talk_id = 8 # change it for testing purpose |