Skip to content

Instantly share code, notes, and snippets.

Dallas Lu dallaslu

Block or report user

Report or block dallaslu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View DuplicateElementUtils.java
package com.v2ex.utils;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class DuplicateElementUtils{
public static <T> List<T> getDuplicateElements(List<T> list){
List<T> result = new ArrayList<T>();
@dallaslu
dallaslu / surge_main.conf
Created Oct 27, 2015 — forked from jason5ng32/surge.conf
Surge Configs ( Both 2 files are needed )
View surge_main.conf
[General]
loglevel = notify
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24,100.64.0.0/10
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24,100.64.0.0/10
// DNS OVERRIDE, REMOVE # IF YOU NEED
# dns-server = 223.6.6.6,223.5.5.5,114.114.114.114,114.114.115.115
[Rule]
View Test.java
public static void main(String[] args) throws Exception {
Class<?> cache = Class.forName("java.lang.Integer$IntegerCache");
Field field = cache.getDeclaredField("cache");
field.setAccessible(true);
Object value = field.get(null);
Array.set(value, 130, 3);
Integer result = 1 + 1;
System.out.println("1 + 1 = " + result);
}
View example.js
require.config({
paths: {
"jquery": "../jquery/2.1.1/jquery.min.js"
}
}); // require 框架
(function($){
window.alert = function( msg ){
$('#message').append( msg );
View gitlab-webhook-push.php
$tag_name = str_replace("refs/tags/","",$json->ref);
$argsment = $tag_name;
if( !empty($json->repository)){
$work_path = $json->repository->git_ssh_url;
$work_path = explode(":", $work_path);
$work_path = explode(".", $work_path[1]);
log_append('work_path: ' . $work_path[0]);
$argsment .= ' ' . $work_path[0];
View package.sh
#!bin/sh
git_foler=~/workspace/$2
if [ ! -d "$git_foler" ]; then
mkdir -p "$git_foler"
echo "cd" $git_foler
group_folder=`dirname $git_foler`
cd $group_folder
echo "git clone" git@192.168.1.4:$2.git
View gitlab-webhook-push.sh
#!bin/sh
# $1 tag name
# $2 work path
ssh package@127.0.0.1 "sh ~/package.sh $1 $2 > /dev/null 2>&1" << EOC
exit
EOC
echo done!
You can’t perform that action at this time.