Skip to content

Instantly share code, notes, and snippets.

View htom78's full-sized avatar

htom78

View GitHub Profile
function getAuthToken () {
// if the current store token expires soon
if (jwt(store.getters['auth/token']).exp - 240 <= (Date.now() / 1000).toFixed(0)) {
// if not already requesting a token
if (authTokenRequest === null) {
authTokenRequest = axios.post('/auth/refresh', {}, { withCredentials: true })
.then(response => {
// request complete and store
resetAuthTokenRequest()
store.commit('auth/refresh', response.data.access_token)
@htom78
htom78 / grab_instagram_users_photos.py
Created March 20, 2017 03:57 — forked from felinx/grab_instagram_users_photos.py
Grab instagram user's photos through client API
# -*- coding: utf-8 -*-
#
# Copyright(c) 2015 http://feilong.me
#
# @author: Felinx Lee <felinx.lee@gmail.com>
#
from tornado.httpclient import HTTPClient, HTTPRequest
from tornado import escape
import hashlib
@htom78
htom78 / gist:3c267c6eb55f0a253dfb8237e905ce4d
Created April 16, 2016 08:52
lechebang mobile verify js code
$("#smsLogin").submit(function(e)
{
var postData = $(this).serializeArray();
var formURL = $(this).attr("action");
$.ajax(
{
url: formURL,
type: "POST",
data: postData, // our data object
dataType: 'json', // what type of data do we expect back from the server
define("logic.wx.trafficH5", function(require, exports) {
function i() {
var e = [];
if (!code && !openId) {
o(0);
return
}
report.setTimePoint(20), a(), mobileData.adShow = "none", h(wxHistory.load(appId, code, cacheOnly).map(function(e) {
return {
mobile: e.mobileNum,
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta content="telephone=no" name="format-detection" />
<title>手机流量充值</title>
<script type="text/javascript">
function sendMessage($openid = '', $data = array(), $message_type = '')
{
global $_W, $_GPC;
$set = $this->getSet();
$tm = $set['tm'];
$templateid = $tm['templateid'];
$member = m('member')->getMember($openid);
$usernotice = unserialize($member['noticeset']);
if (!is_array($usernotice)) {
$usernotice = array();
CREATE TABLE `ims_ewei_shop_member` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uniacid` int(11) DEFAULT '0',
`uid` int(11) DEFAULT '0',
`groupid` int(11) DEFAULT '0',
`level` int(11) DEFAULT '0',
`agentid` int(11) DEFAULT '0',
`openid` varchar(50) DEFAULT '',
`realname` varchar(20) DEFAULT '',
`mobile` varchar(11) DEFAULT '',
{
"data":
[
{
"wx_id": 2037,
"fans": 0,
"level": 0,
"balance": 0,
"last_charge_mobile": null,
"be_agency_time": null,
{
"data":
[
{
"wx_id": 2037,
"fans": 0,
"level": 0,
"balance": 0,
"last_charge_mobile": null,
"be_agency_time": null,
CREATE TABLE `flow_item` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isp` varchar(2) COLLATE utf8_unicode_ci NOT NULL,
`province` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`discounts` varchar(256) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`type` smallint(3) NOT NULL DEFAULT '0',
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,