- Find all image files
find . -type f -name "*.jpg" > images
- Determine if image file is portrait or landscape
find . -type f -name "*.jpg" -exec sh -c "identify -ping -format '%W/%H>1' {} | bc -l" \; > aspect
find . -type f -name "*.jpg" > images
find . -type f -name "*.jpg" -exec sh -c "identify -ping -format '%W/%H>1' {} | bc -l" \; > aspect
public class BookFilterRunner { | |
public static void main(String[] args) { | |
//create a list of books | |
List<Book> books = new ArrayList<>(); | |
books.add(new Book("Moby Dick", 250, "Herman Melville")); | |
books.add(new Book("Alice's Adventures in Wonderland", 190, "Lewis Carrol")); | |
books.add(new Book("Sylvie and Bruno", 400, "Lewis Carrol")); | |
//filter a list of books | |
filterBooks(books, "Lewis Carrol"); |
// | |
// SmoothScroll for websites v1.2.1 | |
// Licensed under the terms of the MIT license. | |
// | |
// You may use it in your theme if you credit me. | |
// It is also free to use on any individual website. | |
// | |
// Exception: | |
// The only restriction would be not to publish any | |
// extension for browsers or native application |
UserDao userDao = Mockito.mock(UserDao.class); | |
ArgumentCaptor<User> captor = ArgumentCaptor.forClass(User.class); | |
Mockito.verify(userDao).save(captor.capture()); | |
//do some testing logic, eg. call save on a userService object, | |
//which internally uses userDao to save the user object | |
//get the user as it was passed to the save method in userDao | |
User user = captor.getValue() |
Mockito.verify(userDao, Mockito.times(2)).save(Mockito.any(User.class)); |
UserService userService = new UserService(); | |
UserDao userDao = Mockito.mock(UserDao.class); | |
userService.setUserDao(userDao); | |
User user = new User("Luigi"); | |
userService.registerNewUser(user); | |
Mockito.verify(userDao).save(Mockito.any(User.class)); |
Mockito.when(userDao.getUserById(111)).thenThrow(new NoResultException()); |
Mockito.when(userDao.getUserById(1L)).thenReturn(new User("Mario")); |
UserDao userDao = Mockito.mock(UserDao.class); |
<?php | |
// Display filters | |
add_filter( 'the_title', 'wptexturize' ); | |
add_filter( 'the_title', 'convert_chars' ); | |
add_filter( 'the_title', 'trim' ); | |
add_filter( 'the_content', 'wptexturize' ); | |
add_filter( 'the_content', 'convert_smilies' ); | |
add_filter( 'the_content', 'convert_chars' ); |