Skip to content

Instantly share code, notes, and snippets.

View glfruit's full-sized avatar

Fruit Lee glfruit

  • Huayan Light Company
  • 6327 ,Anestia West ,Barcelenebort ,Holda ,Hikia
View GitHub Profile
@glfruit
glfruit / init.gradle
Created March 8, 2018 08:47
Mirror setting for gradle
allprojects{
repositories {
def ALIYUN_REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public'
def ALIYUN_JCENTER_URL = 'http://maven.aliyun.com/nexus/content/repositories/jcenter'
all { ArtifactRepository repo ->
if(repo instanceof MavenArtifactRepository){
def url = repo.url.toString()
if (url.startsWith('https://repo1.maven.org/maven2')) {
project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_REPOSITORY_URL."
remove repo
@glfruit
glfruit / build.gradle
Created March 8, 2018 08:46
A simple build file for spring boot project
buildscript {
ext {
springBootVersion = '2.0.0.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
@glfruit
glfruit / # r - 2016-06-02_09-23-32.txt
Created June 2, 2016 01:29
r (homebrew/science/r) on Mac OS X 10.11 - Homebrew build logs
Homebrew build logs for homebrew/science/r on Mac OS X 10.11
Build date: 2016-06-02 09:23:32
@glfruit
glfruit / nvtaggenerator.rb
Created January 20, 2016 13:44
A modified version of nvTagNavigator's script that can handle unicode correctly
# nvTagFinder - Brett Terpstra 2013
#
# Creates a list of tags with links to their associated files in Markdown as a new nvALT note
# Requires "Store as plain text" to be enabled
# Configure default extension and the path to notes folder below
require 'uri'
require 'shellwords'
@glfruit
glfruit / zotpick-pandoc-win.bat
Created December 27, 2015 06:00
Put this file with Set-ActiveWindow.ps1 in the same place and set it as Scrivener's Reference Manager
@start /b powershell -ExecutionPolicy Unrestricted ./Set-ActiveWindow.ps1
@glfruit
glfruit / Set-ActiveWindow.ps1
Created December 27, 2015 05:56
A simple PowerShell script to activate Zotero search dialog while writing in Scrivener
[CmdletBinding()]
Param(
)
Add-Type @"
using System;
using System.Runtime.InteropServices;
public class Zotero {
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetForegroundWindow(IntPtr hWnd);

PS4 网络环境优化

0 案例环境

  • 中国电信 100M 宽带接入,局域网段 192.168.1/24,光猫拥有管理员权限(后继需要);
  • NetGear WNDR3700v2 跑 OpenWRT 作为家庭主路由器, WAN IP 192.168.1.234,局域网段 10.10.10/24
  • PS4 无线连家庭网络(主),IP 10.10.10.3;有线连光猫(备),IP 192.168.1.3
@glfruit
glfruit / 0_reuse_code.js
Created July 26, 2014 00:04
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@glfruit
glfruit / friendly_error_messages.groovy
Last active December 22, 2015 03:19
Friendly Error Messages for Grails
class Bootstrap {
def grailsApplication
def messageSource
def init = { servletContext ->
for(dc in grailsApplication.domainClasses) {
dc.metaClass.getErrorStrings = { Locale locale = Locale.getDefault() ->
def stringsByField = [:].withDefault { [] }
for(fieldErrors in delegate.errors) {