Skip to content

Instantly share code, notes, and snippets.

View xiangzhuyuan's full-sized avatar
🤗

Mathew P. Jones xiangzhuyuan

🤗
View GitHub Profile
@xiangzhuyuan
xiangzhuyuan / bash_default_var.sh
Last active March 24, 2020 13:48
the list of bash default var
#!/bin/bash
#
printf "The complete list is %s\n" "$$"
printf "The complete list is %s\n" "$!"
printf "The complete list is %s\n" "$?"
printf "The complete list is %s\n" "$*"
printf "The complete list is %s\n" "$@"
printf "The complete list is %s\n" "$#"
printf "The complete list is %s\n" "$0"
printf "The complete list is %s\n" "$1"
@xiangzhuyuan
xiangzhuyuan / aj_club_filter.js
Created December 14, 2019 00:35
tempermonkey script to help easy filter aj club event
// ==UserScript==
// @name filter event by aj club name
// @namespace http://tampermonkey.net/
// @version 0.1
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @description add a club index in the head then you could get by event list by club!
// @author Matt
// @match https://www.audax-japan.org/*
// @grant none
// ==/UserScript==
// ==UserScript==
// @name filter aj club
// @namespace http://tampermonkey.net/
// @version 0.1
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @description try to take over the world!
// @author You
// @match https://www.audax-japan.org/*
// @grant none
// ==/UserScript==
ActionDispatch::Routing::RoutesInspector.new(Rails.application.routes.routes).format(ActionDispatch::Routing::ConsoleFormatter.new).split("\n")
@xiangzhuyuan
xiangzhuyuan / unsub_all_youtube_channel.js
Created June 23, 2019 13:43
just run code in console by one click
(function(){
var btns = document.getElementsByTagName('button');
for (var i = 0; i < btns.length; i++) {
if (btns[i].dataset.isSubscribed == "True") {
if (!!btns[i].dataset.showUnsubConfirmDialog) {
delete btns[i].dataset.showUnsubConfirmDialog;
}
btns[i].click();
}
}
@xiangzhuyuan
xiangzhuyuan / gist:32e146fbb667429c037774904bbff035
Created February 11, 2019 13:17
Get latest campaign without afli
require 'net/http'
require 'uri'
require 'cgi'
require 'byebug'
require 'nokogiri'
require 'yaml'
uri = URI.parse("https://blog.cbnanashi.net/2018/10/5575/comment-page-5")
request = Net::HTTP::Get.new(uri)
request["Authority"] = "blog.cbnanashi.net"
@xiangzhuyuan
xiangzhuyuan / python-interview.md
Last active November 19, 2018 10:02
a list questions from here: http://careerride.com/

What is Python? State some programming language features of Python.

Python is a modern powerful interpreted language with objects, modules, threads, exceptions, and automatic memory managements. Python was introduced to the world in the year 1991 by Guido van Rossum Salient features of Python are

  • Simple & Easy: Python is simple language & easy to learn.
  • Free/open source: it means everybody can use python without purchasing license.
  • High level language: when coding in Python one need not worry about low-level details.
  • Portable: Python codes are Machine & platform independent.
  • Extensible: Python program supports usage of C/ C++ codes.
@xiangzhuyuan
xiangzhuyuan / bulk_download_garmin_fit.sh
Created September 21, 2018 08:50
try to bulk download fit file from garmin portal
#!/bin/bash
#var s ='';$("#activity-name-edit > a").each(function(){s+=$(this).attr('href').split('/')[3]; s+="\n";});console.log(s)
ids='3031291759 3031291483 3031291242 3031291096 3031290952 3023644256 3022933525 3017780038 3017658434 3013372497 3009179215 3007461440 3005419661 3004834235 3004833926 2994827251 2994213912 2992526210 2991711451 2989717745'
for id in $ids
do
echo "https://connect.garmin.com/modern/proxy/download-service/files/activity/$id"
curl "https://connect.garmin.com/modern/proxy/download-service/files/activity/$id" -H 'authority: connect.garmin.com' -H 'cache-control: max-age=0' -H 'upgrade-insecure-requests: 1' -H 'dnt: 1' -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36' -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8' -H 'referer: https://connect.garmin.com/modern/activities' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: zh-CN,
@xiangzhuyuan
xiangzhuyuan / download-lofter-image.rb
Created December 19, 2014 09:45
网易 lofter 图片下载
#!/usr/bin/env ruby
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'fileutils'
print 'start....'
base_url = 'http://sakalee.lofter.com/?page='

Keybase proof

I hereby claim:

  • I am xiangzhuyuan on github.
  • I am xiangzhuyuan (https://keybase.io/xiangzhuyuan) on keybase.
  • I have a public key ASA41VFjieEA2WWx2Dtki1d3Yow0ELUp1sZoVsbHkjplUQo

To claim this, I am signing this object: