Skip to content

Instantly share code, notes, and snippets.

View lixingcong's full-sized avatar
😂
Face With Tears of Joy...

Lixingcong lixingcong

😂
Face With Tears of Joy...
View GitHub Profile
@lixingcong
lixingcong / 1.js
Created March 8, 2017 05:55
html续秒js脚本
var _click_count=0;
$("body").bind("click",function(e){
//var n=Math.round(Math.random()*100);//随机数
var $i=$("<b>").text("+"+(++_click_count));
var x=e.pageX,y=e.pageY;
$i.css({
"z-index":99999,
"top":y-15,
"left":x,
@lixingcong
lixingcong / README.md
Last active March 5, 2017 09:49
Twidere_twitter_api

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 / 1.txt
Created March 5, 2017 09:34
一加3:实体返回键互换
vi /system/usr/keylayout/synaptics.kl
CM14.0 中默认的值为
key 580 APP_SWITCH VIRTUAL
key 158 BACK VIRTUAL
以上即为默认值,Back---Home---App布局
@lixingcong
lixingcong / 000-patch.diff
Created March 1, 2017 06:50
gcc-arm-none-eabi on windows
diff --git a/Makefile b/Makefile
index cd97f5b..128ed69 100644
--- a/Makefile
+++ b/Makefile
@@ -3,22 +3,22 @@
include Makefile.common
LDFLAGS=$(COMMONFLAGS) -fno-exceptions -ffunction-sections -fdata-sections -L$(LIBDIR) -nostartfiles -Wl,--gc-sections,-Tlinker.ld
LDFLAGS_USE_NEWLIB=--specs=nano.specs -lc -lnosys
-LDLIBS+=-lstm32
+LDLIBS+="libs\libstm32.a"
@lixingcong
lixingcong / demo1.cpp
Last active April 14, 2021 14:17
C各种指针:数组指针,函数指针,回调函数,指针的引用,指针的指针
#include <iostream>
#include "math.h"
// 数组指针
using namespace std;
const int COL = 2;
void printRowData(int* p)
@lixingcong
lixingcong / AndroidManifest.xml
Last active December 3, 2016 09:08
Android M ask for permission
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="li.grain2">
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
@lixingcong
lixingcong / chnroute_update.txt
Last active September 28, 2021 09:44
chinaroute路由表更新命令
路由表使用cidrmerge进行合并
cat route.txt| cidrmerge > route_merged.txt
https://github.com/karlpilkington/cidrmerge
ipip.net中国大陆路由表(每两个月更新一次)
wget https://github.com/17mon/china_ip_list/raw/master/china_ip_list.txt -O /tmp/route.txt
ChinaRoute ipv4路由表
wget -O- 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | awk -F\| '/CN\|ipv4/ { printf("%s/%d\n", $4, 32-log($5)/log(2)) }' > /tmp/route.txt
@lixingcong
lixingcong / demo_2.1.py
Last active November 19, 2016 06:09
《统计学习方法》例2.1
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Time-stamp: < 1.py 2016-11-19 14:09:19 >
"""
对应《统计学习方法》李航课本的第2章“感知机”的例题2.1
"""
import os
# An example in that book, the training set and parameters' sizes are fixed
@lixingcong
lixingcong / recursively_get_links.py
Last active November 8, 2016 13:53
recursively get web page links
@lixingcong
lixingcong / title_change.js
Created October 24, 2016 07:34
change html tilte when switch over pages
var this_title=document.title;
document.addEventListener('visibilitychange', function() {
document.title = document.hidden ? this_title+":你看不到我~": this_title;
});