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
-- 新增订单 CV 数据清单(1.1 - 4.30) | |
WITH OrderParticipants AS ( | |
-- 收集所有有效的订单和关联分销商 | |
SELECT | |
CASE WHEN ru.role_id = 2 THEN | |
o.distributor_id -- 分销商自己的订单 | |
ELSE | |
o.personal_sponsor_distributor_id -- 客户订单,关联到赞助人 | |
END AS effective_distributor_id, | |
o.id AS order_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 re | |
import zipfile | |
import tempfile | |
import os | |
import shutil | |
from pathlib import Path | |
def process_html_content(content): | |
""" | |
Add <pre> tags around <table class="processedcode"> elements |
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
SELECT * | |
FROM ( | |
SELECT | |
o.distributor_id, | |
ui.firstname || ' ' ||ui.lastname distributor_name, | |
ui.phone, | |
ui.email, | |
to_char(o.state_date, 'YYYY-MM') qualified_date, | |
sum(o.pvq) pvq_total | |
FROM user_infos ui |
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
<!-- /sections/cart.liquid --> | |
{%- liquid | |
assign hide_quantity = 'quantity--hide' | |
if settings.cart_show_quantity | |
assign hide_quantity = '' | |
endif | |
assign ajax_disable = false | |
assign no_ajax_class = '' | |
if settings.cart_style == 'compatible' |
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
<!-- /sections/cart.liquid --> | |
{%- liquid | |
assign hide_quantity = 'quantity--hide' | |
if settings.cart_show_quantity | |
assign hide_quantity = '' | |
endif | |
assign ajax_disable = false | |
assign no_ajax_class = '' | |
if settings.cart_style == 'compatible' |
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
%% http://tomorrowssolutionsllc.com/ConferenceSessions/Turning%20Data%20Sideways.pdf | |
%% https://github.com/VFPX/FastXTab/ | |
LOCAL oXTab AS FastXTab OF "fastxtab\fastxtab.prg" | |
oXTab = NEWOBJECT("fastxtab", "fastxtab\fastxtab.prg") | |
WITH oXTab AS FastXTab OF "fastxtab\fastxtab.prg" | |
.cColField = 'gu_count' | |
.nMultiDataField = 2 %% 以 gu_count 和 gunum 分组,每组显示多个数据 | |
.acDataField[1] = 'clnum' %% 第一计数据是 clnum | |
.acDataField[2] = 'payroll' %% 第二个数据是 payroll |
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
# Question 1: polymorphism - define a function called addall() | |
def addall(x,y): | |
if type(x) != type(y): | |
print 'Test for the function call, addall(',repr(x),',',repr(y),'): The data you entered is not correct.' | |
elif type(x) in [int, float, list, tuple]: | |
print 'The function call, addall(',repr(x),',',repr(y),'), returns',x+y,'.' | |
elif type(x) == set: | |
print 'The function call, addall(',repr(x),',',repr(y),'), returns',x|y,'.' | |
elif type(x) == dict: | |
z = {} |
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
# 用于rails的代码片段,省略了各种引入第三方库的代码 | |
class Dingding | |
def self.get_user_info_by_code code | |
timestamp = (Time.now.to_f * 1000).to_i | |
sign = hmac_sign(APP_SECRET, timestamp) | |
url = "https://oapi.dingtalk.com/sns/getuserinfo_bycode?accessKey=APPID}×tamp=#{timestamp}&signature=#{sign}" | |
RestClient.post(url, { tmp_auth_code: code }.to_json, { 'Content-Type' => 'application/json' }) do |response| | |
return JSON.parse(response.body).symbolize_keys |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |