Skip to content

Instantly share code, notes, and snippets.

@brito
brito / Rephiprocal Raphio
Created June 20, 2016 00:51
The powers of Phi conjugated into whole numbers also converge to Phi
// For any even integer n:
// Phi^n + 1/Phi^n = a whole number
// For any odd integer n:
// Phi n – 1 / Phi n = a whole number
// goldennumber.net/powers-of-phi
function Rephiprocal(x,n){
var P = .5+Math.sqrt(5)/2,
R=Math.pow(P,n);
@brito
brito / Scope.java
Last active June 17, 2016 01:31
MAF or ADF reusable scope POJO class
public class Scope {
private Map<Object, Object> properties = (new HashMap<>(){{
// initialize: put(1, "A");
}})
.forEach( (key, value) ->
// emit: somefunction(key, value)
);
private RichInputText key;
private RichInputText value;
@brito
brito / dabblet.css
Last active May 25, 2016 00:34
K-12 Education Launchpad
/* K-12 Education Launchpad */
@brito
brito / Record.js
Last active January 20, 2016 22:56
/**
____ _
_ __ _____ __ | _ \ ___ ___ ___ _ __ __| |
| '_ \ / _ \ \ /\ / / | |_) / _ \/ __/ _ \| '__/ _` |
| | | | __/\ V V / | _ < __/ (_| (_) | | | (_| |
|_| |_|\___| \_/\_/ |_| \_\___|\___\___/|_| \__,_|
@constructor */
function Record(content){
// Without context, content is meaningless
@brito
brito / iconmaker.sh
Last active October 29, 2015 23:49
Create Oracle MAF icons from a red-on-transparent base icon.
#!/bin/bash
# show progress on console
set -x
# Convert an icon into mobile icons and start screens
# Usage: iconmaker.sh original-icon.png
# pick a $bgcolor from
# oracle.com/webfolder/ux/middleware/alta_icon_web_design_guide/colors-icon_palette.html
@brito
brito / amx.regex
Created September 28, 2015 19:04
Search and replace (remove) in amx files to clean up. Watch out for actual necessary [id].
\s+id="[^"]+"|amx:|:xsi="http://www.w3.org/2001/XMLSchema-instance"\s+xmlns:amx|\s+xmlns:dvtm="http://xmlns.oracle.com/adf/mf/amx/dvt"
@brito
brito / city-of-la-wcp-template.jspx
Created September 22, 2015 19:30
Oracle WebCenter Portal Template Example
<?xml version='1.0' encoding='UTF-8'?>
<!--
City of Los Angeles Template
July 7, 2015
Oracle WebCenter Portal Template
-->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:h="http://java.sun.com/jsf/html"
@brito
brito / dabblet.css
Last active September 9, 2015 18:47
CSS State Transition
/* CSS State Transition
This is all for appearance.
The important CSS is inline with the HTML */
style { font-family:monospace; margin:1em; white-space:pre;
display:block; max-height:0; transition:max-height 125ms; overflow:hidden }
style:before,
[href^="#"]:before { display:block; font-size:.786rem; opacity:.381 }
style:before { content:'<style>' }
style[id]:before { content:'<style id='attr(id)'>' }
:target ~ [href^="#"]:before { content:'<a href='attr(href)'>' }

Keybase proof

I hereby claim:

  • I am brito on github.
  • I am brito (https://keybase.io/brito) on keybase.
  • I have a public key whose fingerprint is 2DEB AB0D DF8E 87B9 D338 A261 CC2D 4EB5 B9B4 1B1B

To claim this, I am signing this object:

@brito
brito / dabblet.css
Last active June 1, 2016 00:33
Golden Typographic Scale
/* Golden Typographic Scale
bit.ly/golden-type_css */
h1, h2, h3 { margin:calc(1.618rem/2) 0 }
h1 { font-size:2.618rem; opacity:.381 }
h2 { font-size:2.058rem; opacity:.618 }
h3 { font-size:1.618rem }
h4 { font-size:1.272rem }
* { font:300 1em/1.618rem FontAwesome, Segoe UI, Avenir;
text-transform:none; text-decoration:none;
letter-spacing:-.01em; word-spacing:.038em; margin:auto }