Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

xiaochi picasso250

💭
I may be slow to respond.
View GitHub Profile
View 阶段.md

我说一下我对现阶段的理解:
这个阶段, 1 因为中美冷战即将开始或者已经开始,中国民众具有较强的民族意识。当前国际的主要矛盾是全球化能不能继续进行的矛盾。 2 国内的状况是经过30年的快速经济发展,执政党具有超乎寻常的合法性,因此执政党和资本家联合起来压迫无产阶级,现阶段是难于反抗的。
那么我们主要任务,在现阶段有二:1 是宣传马克思主义 2 是建立组织,锻炼队伍,保持火种不灭。
至于合作社,其主要目的还是锻炼队伍。其最终结果,我也不看好。 以上是我的个人意见。

View translate-whole-page.user.js
// ==UserScript==
// @name 网页整页翻译(谷歌翻译)
// @author Kaiter-Plus
// @author xiaochi
// @namespace https://gitee.com/Kaiter-Plus/TampermonkeyScript/tree/master/Translate
// @description 给每个非中文的网页左下角添加一个google翻译图标,直接调用 Google 的翻译接口对非中文网页进行翻译
// @exclude /^[http|https].*[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/
// @exclude /lanzous\.com/
// @exclude /w3school.*\.cn/
// @exclude /.*baidu.*/
View bingzhihuancsdn.user.js
// ==UserScript==
// @name 必应去上下广告且知乎去时间线广告且CSDN自动展开全文
// @version 1.1
// @include /^https?://cn\.bing\.com/.*$/
// @include /^https?://www\.zhihu\.com/.*$/
// @include /^https?://blog\.csdn\.net/.*$/
// @grant none
// ==/UserScript==
// 2020/06/19 增加CSDN自动展开全文功能
@picasso250
picasso250 / player.php
Created May 23, 2018
player for youtube-dl (with sub titles) https://rg3.github.io/youtube-dl/
View player.php
<?php
$name = isset($_GET['name'])?trim($_GET['name']):'';
if ($name === '') {
$list = glob("*.mp4");
}
function get_sub_title($name) {
$file = "$name.en.vtt";
if (is_file($file)) return $file; else return false;
}
?>
@picasso250
picasso250 / brain-fuck-to-c.c
Last active Apr 1, 2018
a brain fuck vm writen by c
View brain-fuck-to-c.c
#include <stdio.h>
#include <stdlib.h>
int main() {
int c;
puts("#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\nint main(){char *ptr=malloc(3000);memset(ptr, \'\\0\', 3000);");
while ((c=getchar())!=EOF) {
switch (c) {
case '>': puts("++ptr;"); break;
case '<': puts("--ptr;"); break;
@picasso250
picasso250 / behav-test.php
Last active Mar 30, 2018
a small behavior test framework for php
View behav-test.php
<?php
if (!isset($argv[1])) {
echo "Usage: $argv[0] test_file\n";
exit();
}
$_cur_test_file = $argv[1];
if (!is_file($_cur_test_file)) {
echo "$_cur_test_file not exits\n";
exit(1);
View install-php.sh
#!/bin/bash
wget http://cn2.php.net/get/php-5.6.34.tar.gz/from/this/mirror
mv mirror php-5.6.34.tar.gz
tar xzvf php-5.6.34.tar.gz
cd php-5.6.34
./configure' '--prefix=/data/software/php' '--with-pear' '--enable-bcmath' '--with-bz2' '--with-curl' '--enable-filter' '--enable-fpm' '--with-gd' '--enable-gd-native-ttf' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--enable-intl' '--enable-mbstring' '--with-mcrypt' '--enable-mysqlnd' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-pdo-sqlite' '--disable-phpdbg' '--enable-opcache' '--with-openssl' '--enable-simplexml' '--with-sqlite3' '--enable-xmlreader' '--enable-xmlwriter' '--enable-zip' '--with-zlib'
make
make install
@picasso250
picasso250 / lib.php
Last active Mar 16, 2018
lib of php
View lib.php
<?php
function env_load($dir='.')
{
$file = "$dir/.env";
if (!is_file($file)) {
echo "no .env file $file\n";
exit(1);
}
if (!is_readable($file)) {
@picasso250
picasso250 / sql_placeholder_merge.php
Last active Mar 16, 2018
merge sql placeholder ? and :x
View sql_placeholder_merge.php
<?php
function quote_parse ($sql)
{
$n = mb_strlen($sql);
$state = 0;
$word = '';
$ret = [];
$quote = '';
for ($i=0; $i < $n; $i++) {
$ch = mb_substr($sql, $i, 1);
View Container.php
<?php
namespace Lib;
use Exception;
use Psr\Container\ContainerInterface;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
class Container implements ContainerInterface
{