Skip to content

Instantly share code, notes, and snippets.

View megatontech's full-sized avatar
:octocat:
I'a I'a Cthulhu Fhatgn

威廉伯爵 megatontech

:octocat:
I'a I'a Cthulhu Fhatgn
View GitHub Profile
@megatontech
megatontech / import jquery
Created June 12, 2016 12:10
import jquery
var oHead = document.getElementsByTagName('HEAD').item(0);
var oScript= document.createElement("script");
oScript.type = "text/javascript";
oScript.src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js";
oHead.appendChild( oScript);
function setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires="+d.toUTCString();
document.cookie = cname + "=" + cvalue + "; " + expires;
}
setCookie('op','username=xiali&password=31C9CDA783173B7E17DFFD199F7B8F',5);
@megatontech
megatontech / 3月之内记录
Created January 10, 2017 06:48
3月之内记录SQL
SELECT
top (8) col
FROM
test
WHERE
EditDate BETWEEN DATEADD(m ,- 3, GETDATE())
AND getdate()
ORDER BY
ID DESC;
@megatontech
megatontech / list 内部字段分割求和并排序
Created June 13, 2017 08:04
list 内部字段分割求和并排序
tempList.ForEach(x => x.Sort = (Array.ConvertAll<string,int>(x.DayOfStayDays.Split(','),delegate(string s){ return ConvertVal.GetValInt(s); }).Sum()));
@megatontech
megatontech / 批量关注linkedin
Created August 2, 2019 03:29
批量关注linkedin
$(".artdeco-button").each(function(){this.click()})
@megatontech
megatontech / 批量关注user
Created August 2, 2019 03:31
批量关注user
//follow all user following openbilibili
window.location.href="https://lnkd.in/f2fTAWm";
for(var i=0;i<document.getElementsByClassName("btn-sm").length;i++){if(document.getElementsByClassName("btn-sm")[i].value=="Follow"){document.getElementsByClassName("btn-sm")[i].click();console.log(document.getElementsByClassName("btn-sm")[i].title)} }
@megatontech
megatontech / 数字金额大写转换
Created August 2, 2019 03:35
数字金额大写转换
//数字金额大写转换(可以处理整数,小数,负数) */
var digitUppercase = function (n) {
var fraction = ['角', '分'];
var digit = [
'零', '壹', '贰', '叁', '肆',
'伍', '陆', '柒', '捌', '玖'
];
var unit = [
['元', '万', '亿'],
['', '拾', '佰', '仟']
@megatontech
megatontech / 输入限制为数字带小数点
Created August 2, 2019 03:36
输入限制为数字带小数点
<input type="text" onkeyup="this.value=this.value.replace(/[^(\-?)\d.]/g,'')" class="inputJieFang" />
@megatontech
megatontech / 替换url中的参数
Created August 2, 2019 03:37
替换url中的参数
var replaceParamVal = function (paramName, replaceWith) {
var oUrl = this.location.href.toString();
var re = eval('/(' + paramName + '=)([^&]*)/gi');
var nUrl = oUrl.replace(re, paramName + '=' + replaceWith);
this.location = nUrl;
window.location.href = nUrl
}
@megatontech
megatontech / synthwave84 config
Created August 7, 2019 07:48
synthwave84 config
{
"go.autocompleteUnimportedPackages": true,
"files.autoGuessEncoding": true,
"window.closeWhenEmpty": true,
"go.buildOnSave": "workspace",
"go.lintOnSave": "package",
"go.vetOnSave": "package",
"go.buildTags": "",
"go.buildFlags": [],
"go.lintFlags": [],