Skip to content

Instantly share code, notes, and snippets.

Avatar
😂
Face With Tears of Joy...

Lixingcong lixingcong

😂
Face With Tears of Joy...
View GitHub Profile
@lixingcong
lixingcong / fetchUrl_gzip.php
Created Feb 8, 2021 — forked from mgng/fetchUrl_gzip.php
file_get_contents で Accept-Encoding:gzip 指定
View fetchUrl_gzip.php
<?php
function fetchUrl( $url, $gzip = false ) {
$raw = file_get_contents( $url, false, $context = stream_context_create( array(
'http' => array(
'method' => 'GET',
'header' => 'Accept-Encoding:' . ( $gzip ? 'gzip,deflate' : 'identity' ) . "\r\n",
)
) ) );
if ( $raw === false ) {
@lixingcong
lixingcong / delete_git_submodule.md
Created Dec 30, 2020 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.
View delete_git_submodule.md

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@lixingcong
lixingcong / README.md
Last active Mar 5, 2017
Twidere_twitter_api
View README.md

How to use

  1. Copy one of the consumer key pairs to Twidere - Settings - Network - Advanced - Default API Settings
  2. Remove account from Twidere (or just skip this step)
  3. Re-login. It's OK to see "You've already logged in" message.
@lixingcong
lixingcong / README.md
Created Sep 16, 2016 — forked from smileart/README.md
My ZSH Theme — Agnoster Mod
View README.md

My modified fork of agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

Compatibility

@lixingcong
lixingcong / probe.php
Created Sep 14, 2016 — forked from DrayChou/p.php
lnmp 中带的 php 探针
View probe.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']));
@lixingcong
lixingcong / aria2
Created Sep 13, 2016 — forked from andrzejressel/aria2
init.d file for aria2c daemon (debian)
View aria2
#!/bin/sh
### BEGIN INIT INFO
# Provides: aria2
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: aria2c init script.
@lixingcong
lixingcong / aria2.bat
Created Sep 12, 2016 — forked from aa65535/aria2.bat
Aria2的配置文件 & 启动脚本
View aria2.bat
:: 启动后需要保留窗口, 关闭窗口则结束进程
aria2c --conf-path=aria2.conf -D
@lixingcong
lixingcong / sample-google.c
Created Sep 10, 2016 — forked from davidzchen/sample-google.c
Sample C code using the Google C++ style guide
View sample-google.c
// Sample file using the Google C++ coding standard.
//
// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
//
// General rules:
// - Indents are two spaces. No tabs should be used anywhere.
// - Each line must be at most 80 characters long.
// - Comments can be // or /* but // is most commonly used.
// - File names should be lower_case.c or lower-case.c
//