Skip to content

Instantly share code, notes, and snippets.

View xiangzhuyuan's full-sized avatar
🤗

Mathew P. Jones xiangzhuyuan

🤗
View GitHub Profile
@xiangzhuyuan
xiangzhuyuan / ruby_str_remove_allwhitespace.md
Created August 17, 2017 02:48
ruby string remove all whitespace
#[codility]MinAvgTwoSlice
def solution(A):
# write your code in Python 2.6
# if one slice is the MA, then the average of its subslices
# can not be smaller and also it can not be bigger, or the average of the
# whole slice will change
# every slice can be divide into two kinds of subslices, e.g., two-element and three element
@xiangzhuyuan
xiangzhuyuan / ruby_method_parameter.rb
Last active January 14, 2022 01:38
ruby method parameter
#https://docs.ruby-lang.org/ja/latest/class/Method.html#I_PARAMETERS
#ruby 的方法参数定义还是挺绕的, 足够灵活,足够困扰...
#从定义到使用, 似乎在两边会出现一些`意想不到`的事情.
#就是在定义这个方法的时候可能想是这样的, 结果后来在使用的时候却又忘记了初衷.
def a_method(a, b = 1, c = 2, d = 3, *aa, cli: true)
puts "......................."
puts "a #{a} |"
puts "b #{b} |"
puts "c #{c} |"
puts "d #{d} |"
@xiangzhuyuan
xiangzhuyuan / inst-admin.rb
Created July 4, 2021 13:35
get instagram following list
require 'net/http'
require 'uri'
require 'json'
require 'byebug'
followers = []
1000000.times do |t|
target = "https://i.instagram.com/api/v1/friendships/35182405/following/?count=#{12 * t}12&max_id=#{0 + 12 * t}"
@xiangzhuyuan
xiangzhuyuan / gist:345593dea44c68904c7f92da58fe0fb8
Created December 29, 2020 02:38
a monkey script to remove add popup when open swarm POS page
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://ja.swarmapp.com/xiangzhuyuan/checkin/5b8ae76295a722002cc568d9
// @grant none
// ==/UserScript==
@xiangzhuyuan
xiangzhuyuan / spring.md
Created September 15, 2020 13:43
spring

Spring 学习笔记

  • Spring 核心
  • Sprint boot
  • Sprint 最新动态spring

为什么是 spring

@xiangzhuyuan
xiangzhuyuan / spring.md
Last active September 15, 2020 13:28
spring/java

Spring 学习笔记

  • Spring 核心
  • Sprint boot
  • Sprint 最新动态spring

Java 学习笔记

@xiangzhuyuan
xiangzhuyuan / spring
Created September 7, 2020 14:35
sprint
# Spring 学习笔记
- Spring 核心
- Sprint boot
- Sprint 最新动态
# Java 学习笔记
@xiangzhuyuan
xiangzhuyuan / sprint batch
Created September 7, 2020 14:33
sprint batch
[INFO] --- maven-dependency-plugin:3.1.2:tre...
[INFO] +- org.springframework.boot:spring-boot-starter-batch:jar:2.3.0.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:2.3.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:2.3.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.3.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:2.3.0.RELEASE:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.2.3:compile
# spec/spec_helper.rb
require 'webmock/rspec'
WebMock.disable_net_connect!(allow_localhost: true)