Skip to content

Instantly share code, notes, and snippets.

{% extends layout %}
{% block body %}
<div id="main">
<h2>Contact me</h2>
<p>For queries about anything on this website, or for job quotations, please contact me using the contact form below or via <a href="mailto:email@email.com">email</a>.</p>
<form action="#" method="post">
{{ form_start(form) }}
{{ form_errors(form) }}
public class Promises {
private static class PageMetrics {
Integer visits;
Long avgMsOnPage;
@Override
public String toString() {
return String.format("{ avgMsOnPage=%d, visits=%d }", avgMsOnPage, visits);
}
package com.hanhuy.android.common.concurrent;
import android.os.AsyncTask;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Callable;
package testlargestarray;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
import java.util.stream.*;
/*
Problem: Given a list of random numbers, both positive and negative, find the
largest sum of a sublist.
<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d56790.47490202523!2d78.042155!3d27.175014999999924!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x39747121d702ff6d%3A0xdd2ae4803f767dde!2sTaj+Mahal!5e0!3m2!1sen!2s!4v1398864446719" width="800" height="600" frameborder="0" style="border:0"></iframe>
package net.branchandbound.builder;
public class PizzaOrderNewStyle {
private int size;
private boolean pepperoni;
private boolean chicken;
private boolean mushroom;
private boolean peppers;
private String cheese;
@esfand
esfand / completablefuture.md
Last active August 29, 2015 14:01
CompletableFuture

Class CompletableFuture Class

public class CompletableFuture<> extends `Object`
implements interface in Future, CompletionStage<>

A Future that may be explicitly completed (setting its value and status), and may be used as a CompletionStage, supporting dependent functions and actions that trigger upon its completion.

#!/bin/bash
mkdir -p bin sources/{config,twig,sql,lib/{Model,Controller}} web/{css,images,js} tests documentation log
chmod 777 log
> web/favicon.ico
cat > bin/generate_model.php <<"EOF"
<?php // bin/generate_model.php
$app = require(__DIR__."/../sources/bootstrap.php");
<?php
// src/Foobar/Controller/FooController.php
namespace Foobar\Controller;
class FooController
{
public function helloAction($request)
{