Skip to content

Instantly share code, notes, and snippets.

View lwl5219's full-sized avatar

Jolin lwl5219

  • LineKong
  • ChaoYang, BeiJing
View GitHub Profile
@lwl5219
lwl5219 / sublime-text-3-windows-shortcuts.md
Last active October 23, 2018 01:28 — forked from mrliptontea/sublime-text-3-windows-shortcuts.md
[Sublime Text 3 - Shortcuts] (Windows)

Sublime Text 3 - Useful Shortcuts (Windows)

General

Shortcut Description
Ctrl+Shift+P command prompt
Ctrl+Alt+P switch project
Ctrl+P go to file
Ctrl+G go to line
@lwl5219
lwl5219 / helper.cs
Last active November 22, 2018 05:06
.Net 通过反射的方式调用成员函数
public class Helper
{
/// <summary>
/// Runs a method on a type, given its parameters. This is useful for calling private methods.
/// </summary>
/// <returns>The return value of the called method.</returns>
public static object RunStaticMethod(System.Type t, string strMethod, object[] aobjParams, Type[] types) {
BindingFlags eFlags = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
return RunMethod(t, strMethod, null, aobjParams, eFlags, types);
}
@lwl5219
lwl5219 / remotefiles.conf
Created January 13, 2019 02:33 — forked from bennylope/remotefiles.conf
nginx remote file proxying
location ~* ^/remote-files/(http[s]*://)(.*?)/(.*) {
# Do not allow people to mess with this location directly
# Only internal redirects are allowed
internal;
# nginx has to be able to resolve the remote URLs
resolver 8.8.8.8;
# Location-specific logging
#access_log /usr/local/etc/nginx/logs/internal_redirect.access.log main;
@lwl5219
lwl5219 / List.java
Created April 8, 2019 10:01
[The basic of Java] #JavaBase
// 1. Convert List to Array
private String[] toString(List<String> list) {
String[] as = new String[list.size()];
as = list.toArray(as);
return as;
}
@lwl5219
lwl5219 / sed.sh
Last active April 8, 2019 10:13
[Useful bash commands] #cmd
##### Use the contents of a file to replace a string using SED
# You can use the `r` command.
# Reference: https://stackoverflow.com/a/6790967/1673077
# Example: use the contents of fileA.txt to replace the line that contains 'china' in fileB.txt
sed -i -e '/china/{r fileA.txt' -e 'd' -e '}' fileB.txt
# 启动远程调试
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -jar kindle-push-1.0.0-jar-with-dependencies.jar
# 运行可执行 jar
java -jar kindle-push.jar
# 执行指定 class 的 main 函数
java -cp kindle-push.jar kindle.MailSender.main
@lwl5219
lwl5219 / HttpSimulator.cs
Last active November 20, 2019 04:05
Http simulator for Unit Test. You can get more detail at https://haacked.com/archive/2005/06/11/simulating_httpcontext.aspx/
using System;
using System.Collections.Specialized;
using System.IO;
using System.Security.Principal;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Configuration;
using System.Web.Hosting;
using System.Web.SessionState;
@lwl5219
lwl5219 / encn_LDOCE5MDX.js
Last active January 15, 2020 09:41
Dictionary scripts for Google Chrome plugin ODH
/* global api */
class encn_LDOCE5MDX {
constructor(options) {
this.options = options;
this.maxexample = 6;
this.word = '';
}
async displayName() {
return '朗文英汉5词典(MDX)';