Skip to content

Instantly share code, notes, and snippets.

public class TicketOffice {
private long amount;
private Theater theater;
private final List<Ticket> tickets = new ArrayList<>();
public TicketOffice(final long amount, final Theater theater) {
this.amount = amount;
this.theater = theater;
}
@perfectacle
perfectacle / app.js
Last active January 25, 2019 08:36
Node.js Hello World Server
require('http').createServer((req, res) => {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World');
}).listen(8080);
@perfectacle
perfectacle / java-10-install.config
Last active March 10, 2020 05:21
Installation of OpenJDK 10 in AWS Elastic Beanstalk with ebextensions
# make shell script
files:
"/opt/elasticbeanstalk/tasks/install-openjdk-10.sh" :
mode: "000755"
owner: root
group: root
content: |
if [[ $(javac -version) != *"javac 10"* ]]
then
# please check recently openjdk version.
@perfectacle
perfectacle / es2015.js
Last active July 17, 2017 07:34
phantomjs-prebuilt v2.1.14 for infinite scroll
// this code must to transpile with babel
const page = require('webpage').create();
const URI = ''; // infinite URI
page.open(URI, () => {
// previous height
let base = 0;
// current height
let tmp = 0;