Skip to content

Instantly share code, notes, and snippets.

@remgoo
remgoo / Optional用法
Created June 28, 2019 04:04
createInWebOptional用法
//null情况
Optional< String > fullName = Optional.ofNullable( null );
System.out.println( "Full Name is set? " + fullName.isPresent() );
System.out.println( "Full Name: " + fullName.orElseGet( () -> "[none]" ) );
System.out.println( fullName.map( s -> "Hey " + s + "!" ).orElse( "Hey Stranger!" ) );
//非空情况
Optional< String > firstName = Optional.of( "Tom" );
System.out.println( "First Name is set? " + firstName.isPresent() );
System.out.println( "First Name: " + firstName.orElseGet( () -> "[none]" ) );
System.out.println( firstName.map( s -> "Hey " + s + "!" ).orElse( "Hey Stranger!" ) );
@remgoo
remgoo / js2.js
Created January 18, 2012 13:14
remjs1test
alert("hhhhhhhhhhhhhhhhhh2222222222222222");
@remgoo
remgoo / 126.test.js
Created January 18, 2012 13:03
A javascript test login www.126.com
/*
http://www.126.com/ Auto Login => A javascript snippet to help you auto login www.126.com
Copyright (C) 2011 Kevintop
Includes jQuery
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes 126.login.js