Skip to content

Instantly share code, notes, and snippets.

View ycrao's full-sized avatar
🎯
Focusing

飞扬 ycrao

🎯
Focusing
View GitHub Profile
@ycrao
ycrao / destructuring.es6.js
Last active February 17, 2017 08:10
es6_1
let [a, b, c] = [1, 2, 3];
@ycrao
ycrao / 0_reuse_code.js
Last active September 17, 2015 07:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ycrao
ycrao / validate.md
Last active August 12, 2021 08:07
中国大陆手机号、车牌号正则验证

大陆手机号

<?php

function validateMobile($mobile, $strict = true) {
  
/*
# 匹配中国大陆国内手机号正则表达式
@ycrao
ycrao / LOL_CG_Picture_Downloader.ahk
Created September 15, 2014 05:16
英雄联盟全英雄原画壁纸下载器
/*
脚本名称: LOL_CG_Picture_Downloader
脚本编码: UTF-8(with BOM)
脚本说明: 英雄联盟全英雄原画壁纸下载器
脚本版本: 1.0
脚本作者: 飞扬网络工作室 (fysoft)
作者官网: http://raoyc.com/fysoft/
交流Q群: 260655062
运行环境: 作者在编码或测试此脚本时所使用的运行环境为 Windows XP SP3 + AutoHotkey(L) v1.1.09.04,其它相异于此运行环境的,请自行测试脚本兼容性问题
版权申明: 非商业使用,在此脚本基础上所作出的修改,需保留原作者署名信息(作者名和官网链接)
@ycrao
ycrao / YuiCompressorGUI.ahk
Created September 14, 2014 02:45
YuiCompressorGUI.ahk
#SingleInstance force
#NoTrayIcon
yuic_path = %A_ScriptDir%\javabin\yuicompressor-2.4.7.jar
batfilename=yuic.bat
IfNotExist, %yuic_path%
{
Msgbox, YuiCompressor文件缺失,请确保javabin子目录下有yuicompressor-2.4.7.jar文件
ExitApp
}
IfExist, %yuic_path%
@ycrao
ycrao / mryw.php
Created September 14, 2014 02:24
每日一文 PHP CURL
<?php
function GetSources($Url,$User_Agent='',$Referer_Url='') //抓取某个指定的页面
{
//$Url 需要抓取的页面地址
//$User_Agent 需要返回的user_agent信息 如“baiduspider”或“googlebot”
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $Url);
curl_setopt ($ch, CURLOPT_USERAGENT, $User_Agent);
curl_setopt ($ch, CURLOPT_REFERER, $Referer_Url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
@ycrao
ycrao / DownloadEssay.ahk
Last active August 29, 2015 14:06
每日一文采集器
;filename:DownloadEssay.ahk
;Author:sunshine
;QQ:837454876
DownloadEssay(filename, today, israndom, templatepath, filepath, url)
{
URLDownloadToFile, %url%, mobile
FileRead, html, *P65001 mobile ;*P65001:utf-8编码 *P936 gb2312编码
RegExMatch(html, "(?<=<title>)(.*)(?=</title>)", _htmltitle)
RegExMatch(html, "(?<=div\sclass=""container"">)(.*)(?=<div class=""nav"")",_essay)
StringReplace, _essay, _essay, %A_Tab%, , A