Skip to content

Instantly share code, notes, and snippets.

/**
* Type-safe builder pattern in Java with Phantom Types
*/
public class PhantomType {
private static interface Filled {}
private static interface Empty {}
public static class Builder<T1, T2> {
private String name;
private String address;
This app doesn't collect any user's location information. The location capability is only used for showing your current location in the map and is disabled by default. You can enable this feature in the settings. That said, the location is ONLY known to yourself.
@cute-jumper
cute-jumper / emacs-lisp-y-combinator.el
Last active November 15, 2023 18:09
Y Combinator in Emacs Lisp
;; Based on https://rosettacode.org/wiki/Y_combinator#Common_Lisp
;; Y combinator in Emacs Lisp
(require 'cl-lib)
(defun Y (f)
((lambda (x) (funcall x x))
(lambda (y) (funcall f (lambda (&rest args)
(apply (funcall y y) args))))))
@cute-jumper
cute-jumper / helm-zsh-path-expansion.el
Last active February 8, 2017 21:47
Make it work in other sources
;;; -*- lexical-binding: t; -*-
;; see http://cute-jumper.github.io/emacs/2015/11/17/let-helm-support-zshlike-path-expansion
(with-eval-after-load 'helm-files
;; Let helm support zsh-like path expansion.
(defvar helm-ff-expand-valid-only-p t)
(defvar helm-ff-sort-expansions-p t)
(defvar helm-ff-ignore-case-p t)
(defun helm-ff--generate-case-ignore-pattern (pattern)