Skip to content

Instantly share code, notes, and snippets.

View zyzsdy's full-sized avatar
🦀
想吃蟹

Ted Zyzsdy zyzsdy

🦀
想吃蟹
View GitHub Profile
@zyzsdy
zyzsdy / letv_getUrl.php
Last active April 23, 2018 09:39
PHP用乐视云视频绝对地址获取器
<?php
//生成api所需信息
$times = time();
$uu = "ab417c1571";//B站uu
$vu = "1233a5fc63";//视频vu
$sign_f = "cfflashformatjsonran".$times."uu".$uu."ver2.2vu".$vu."2f9d6924b33a165a6d8b5d3d42f4f987";//合并签名参数
$sign = md5($sign_f);//计算签名
$api = "http://api.letvcloud.com/gpc.php?cf=flash&sign=".$sign."&ver=2.2&format=json&uu=".$uu."&vu=".$vu."&ran=".$times;//计算api地址
//访问api取得详细信息
$res = file_get_contents($api);
@zyzsdy
zyzsdy / PDO_Tutorial.php
Created November 25, 2015 16:25
PHP PDO Tutorial example code.
<?php
/*
* PHP PDO Tutorial
* Author: zyzsdy <zysdy@gmail.com>
* Github: https://github.com/zyzsdy
*/
$DB_INFO = array(
'type' => 'mysql',
'host' => 'localhost',
'port' => '3306',
@zyzsdy
zyzsdy / vue_test_1.html
Last active December 6, 2015 11:07
用Vue.js实现的两个根据输入实时显示颜色的Web App。
<!doctype html>
<html>
<head>
<title>Test</title>
<script src="vue.min.js"></script>
<style>
body{
margin: 0;
}
.out{
@zyzsdy
zyzsdy / Gruntfile.js
Created December 7, 2015 13:40
grunt极速教程配套代码。
module.exports = function (grunt){
grunt.initConfig({
uglify: {
options:{
},
app_task:{
files:{
'./anna.min.js': './anna.js'
}
function convert(str){
function getUTF8Length(first3){
var code = parseInt(first3.substr(1), 16);
if((code >> 7 & 1) == 0) return 1;
if((code >> 6 & 1) == 0) return 0;
if((code >> 5 & 1) == 0) return 2;
if((code >> 4 & 1) == 0) return 3;
if((code >> 3 & 1) == 0) return 4;
return 0;
}
@zyzsdy
zyzsdy / a.js
Created May 9, 2017 11:31
千万不要试着运行它
// The Module object: Our interface to the outside world. We import
// and export values on it, and do the work to get that through
// closure compiler if necessary. There are various ways Module can be used:
// 1. Not defined. We create it here
// 2. A function parameter, function(Module) { ..generated code.. }
// 3. pre-run appended it, var Module = {}; ..generated code..
// 4. External script tag defines var Module.
// We need to do an eval in order to handle the closure compiler
// case, where this code here is minified but Module was defined
// elsewhere (e.g. case 4 above). We also need to check if Module
@zyzsdy
zyzsdy / frrnfreetalk2.ass
Created May 13, 2017 15:50
爱爱freetalk字幕
[Script Info]
; Script generated by Aegisub 3.2.2
; http://www.aegisub.org/
Title: Default Aegisub file
ScriptType: v4.00+
WrapStyle: 0
ScaledBorderAndShadow: yes
YCbCr Matrix: TV.601
PlayResX: 1280
PlayResY: 720
@zyzsdy
zyzsdy / main.cpp
Last active November 28, 2017 06:37
空空的数据课程设计实验
#include <algorithm>
#include <iostream>
#include <sstream>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
int maxvIfChoose;
@zyzsdy
zyzsdy / doc.js
Last active December 27, 2023 03:23
FFXIV简易版时间和天气计算库
//I 艾欧泽亚时间
//1. 当前艾欧泽亚时间
let nowET = new EorzeaClock(); // EorzeaClock {date: Sun Jul 27 2955 22:23:11 GMT+0800 (中国标准时间)}
// 注意这里的date元素在打印的时候加上了本地时区,但是实际的艾欧泽亚时间是取UTC的时间
//2. 小时分钟字符串(常见表示形式)
nowET.toHourMinuteString(); // 14:24
//3. 基于小时的时间差计算(其他的不常用就没有提供)
@zyzsdy
zyzsdy / rtmp-nginx-install.sh
Created December 9, 2017 14:50
快速编译带有rtmp的nginx
#!/bin/bash
echo "START Config SOLA LIVE"
echo " "
set -e
workroot=`pwd`
# Install Base Tools
echo "Download base tools and source."
sudo apt-get install -y dpkg-dev vim git