Skip to content

Instantly share code, notes, and snippets.

View CristianoPassos's full-sized avatar

Cristiano Passos CristianoPassos

View GitHub Profile
for f in apple banana cherry date fig grape lemon melon
do
/usr/bin/amqp-publish --url=$BROKER_URL -r job1 -p -b $f
done
apiVersion: batch/v1
kind: Job
metadata:
name: job-wq-1
spec:
completions: 8
parallelism: 2
template:
metadata:
name: job-wq-1
apiVersion: v1
kind: Service
metadata:
labels:
component: rabbitmq
name: rabbitmq-service
spec:
ports:
- port: 5672
selector:
@Entity
@Table
public class Role {
@Id
@GeneratedValue
private Long id;
@ManyToMany
private Collection<User> users;
}
public interface MyServiceInterface {
void myMethod();
}
@Service
public class MyServiceA implements MyServiceInterface {
@Override
public void myMethod() {
System.out.print("Do A");
}
@Service
public class UserManagementService {
@Autowired
private UserService userService;
public void processUser(User user) {
userService.processAndSave(user);
}
}
@CristianoPassos
CristianoPassos / clocks24.md
Last active November 27, 2018 14:29
How could you design and implement the API for the user stories below?

clocks24.cn

Clock Image

Stories:

  • details of a single clock
  • list of all clocks
  • add/update a single clock
  • search clocks by description
@CristianoPassos
CristianoPassos / Account.java
Last active October 26, 2018 11:21
Here’s a class one of your interns wrote. You’re reviewing it before it goes to QA.
public class Account {
private String accountNumber;
public Account(String accountNumber) { // Constructor
this.accountNumber = accountNumber;
}
public String getAccountNumber() {
return accountNumber; // return the account number
}
@CristianoPassos
CristianoPassos / git_remove_merged_branches.sh
Created September 17, 2018 10:28
Remove merged Git branches
#!/bin/bash
MAIN=${1:-master}
BRANCHES=$(git branch --merged $MAIN | grep -v -e 'master\|staging\|development\|\*')
git pull
clear
echo Branches merged into $MAIN: