Skip to content

Instantly share code, notes, and snippets.

View raymondmars's full-sized avatar

Raymond raymondmars

  • Mars
View GitHub Profile
@raymondmars
raymondmars / xueqiu_cleaner.js
Last active July 31, 2019 01:43
Xueqiu Cleaner
// ==UserScript==
// @name Xueqiu Cleaner
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Let xueqiu clean
// @author Raymond Jiang (weixin: hellolaojiang)
// @match https://xueqiu.com/
// @grant none
// ==/UserScript==
@raymondmars
raymondmars / springboot.sh
Created May 2, 2018 06:23
Springboot demo bash script
#!/bin/bash
springdemopath=./demo/src/main/java/com/demo/test && mkdir -p "$springdemopath" && touch "$springdemopath/Application.java" && { cat >> "$springdemopath/Application.java" <<-EOF
package com.demo.test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
# Install dependencies
#
# * checkinstall: package the .deb
# * libpcre3, libpcre3-dev: required for HTTP rewrite module
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \
mkdir -p ~/sources/ && \
# Compile against OpenSSL to enable NPN
@raymondmars
raymondmars / wechat-useragent.js
Created November 19, 2015 06:38 — forked from GiaoGiaoCat/wechat-useragent.js
微信内置浏览器UserAgent的判断
// 检测浏览器的 User Agent 应该是非常简单的事情
// 微信在 Android 下的 User Agent
mozilla/5.0 (linux; u; android 4.1.2; zh-cn; mi-one plus build/jzo54k) applewebkit/534.30 (khtml, like gecko) version/4.0 mobile safari/534.30 micromessenger/5.0.1.352
// 微信在 iPhone 下的 User Agent
mozilla/5.0 (iphone; cpu iphone os 5_1_1 like mac os x) applewebkit/534.46 (khtml, like gecko) mobile/9b206 micromessenger/5.0
// 通过javascript判断
// 很容易看出来,微信的 User Agent 都有‘micromessenger’字符串标示,我们判断是否含有这些字符串就OK了
function isWeixinBrowser(){
@raymondmars
raymondmars / Robot_Vim_Dotfile
Created September 12, 2015 03:24
Vimrc file
syntax on
" set color theme
"colorscheme blackboard
colorscheme busybee
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
@raymondmars
raymondmars / get_upcase.rb
Created August 5, 2015 05:50
提取字符串中得的大写字符
class String
def get_upcase
self.split('').map(&:ord).select{|x| x >=65 and x<=90}.map(&:chr)
end
end
@raymondmars
raymondmars / deploy.js
Last active September 8, 2022 08:19
Node project deploy script
'use strict';
module.exports = function(grunt) {
// Please see the Grunt documentation for more information regarding task
// creation: http://gruntjs.com/creating-tasks
grunt.registerMultiTask('deploy', 'Your task description goes here.', function() {
var self = this;
var done = self.async();
syntax on
" set color theme
"colorscheme blackboard
colorscheme busybee
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()