Skip to content

Instantly share code, notes, and snippets.

View DrayChou's full-sized avatar
😸

Dray DrayChou

😸
View GitHub Profile
// ==UserScript==
// @name 抓取30天之前的推文ID
// @namespace dray
// @version 1.0
// @description 抓取 Twitter 我的推文页面中30天之前的所有推文的ID
// @author dray
// @match https://twitter.com/*
// @grant none
// @run-at document-start
// @require unsafe-inline
// Website you intended to retrieve for users.
const upstream = 'api.openai.com'
// Custom pathname for the upstream website.
const upstream_path = '/'
// Website you intended to retrieve for users using mobile devices.
const upstream_mobile = upstream
// Countries and regions where you wish to suspend your service.
@DrayChou
DrayChou / delete-likes-from-twitter.md
Created March 16, 2021 14:46 — forked from aymericbeaumet/delete-likes-from-twitter.md
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
#!/usr/bin/env bash
# SOURCE: https://eligiblestore.com/blog/2017/05/02/how-to-install-mosh-on-centos/
# ensure running as root
if [[ "$(id -u)" != "0" ]]; then
exec sudo "$0" "$@"
fi
# install mosh
yum install -y epel-release
<?php
/**
* 生成短连接的相关方法--通过记录ID换算成为58位的字符串(十进制转换成58进制)
*/
class BaseConvert {
const key_code_64 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$';
const key_code_58 = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ';
<?php
/**
* crontab 时间格式php解析类(PHP 5 >= 5.1.0)
*
* @author 肖武 <tsxw24@gmail.com>
* @link https://code.google.com/p/xwcrontab/
*/
class XwCrontab {
<?php
$file_id = "1XSE7fHxtV-etUze91fkbRKaZodDPmQx9G_6Kc8I9sPE";
$access_token = "ya29.Ci-9A9Ckkgr6hn7Uu2UdNOm8XxK20jHNu3VfDT9mV_LbR2LmCYSo4ced8DOuEZif1g";
$url = "https://drive.google.com/thumbnail?sz=w320&id=" . $file_id;
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
<?php
ini_set('memory_limit', '4G');
if (mb_internal_encoding() != "UTF-8") {
mb_internal_encoding("UTF-8");
}
$file = "test2.txt"; // 一个编码为gbk的中文文件
// $encodeings = mb_list_encodings();
@DrayChou
DrayChou / shadow.sh
Created August 25, 2016 15:23 — forked from bumaociyuan/shadow.sh
极路由安装ss
#!/bin/sh
#
echo ''
echo '/*教程请参考:极路由Shadowsocks家庭无痛翻墙实践*/'
echo 'https://luolei.org/hiwifi-shadowsocks/'
echo 'by @foru17'
echo ''
echo ''
echo '那一天,'
echo '人类终于回想起了,'
@DrayChou
DrayChou / p.php
Created December 25, 2013 03:54
lnmp 中带的 php 探针
<?php
/* ----------------本探针基于YaHei.net探针------------------- */
error_reporting(0); //抑制所有错误信息
@header("content-Type: text/html; charset=utf-8"); //语言强制
ob_start();
$title = "雅黑PHP探针";
$version = "v0.4.2"; //版本号
define('HTTP_HOST', preg_replace('~^www\.~i', '', $_SERVER['HTTP_HOST']));