Skip to content

Instantly share code, notes, and snippets.

var Col = require('react-bootstrap/lib/Col')
var PageHeader = require('react-bootstrap/lib/PageHeader')
var React = require('react')
var Row = require('react-bootstrap/lib/Row')
var {connect} = require('react-redux')
var {reduxForm} = require('redux-form')
var DateInput = require('./DateInput')
var FormField = require('./FormField')
var LoadingButton = require('./LoadingButton')
@headius
headius / ffi-jep.md
Last active January 26, 2016 00:57
JDK Enhancement Proposal: FFI

Title: Foreign Function Interface Author: Charles Oliver Nutter Organization: Red Hat Owner: Charles Oliver Nutter Created: 2014/01/28 Type: Feature State: Draft Exposure: Open Component: --/-- Scope: JDK

@eribeiro
eribeiro / weakref-snippet.java
Last active January 5, 2017 14:34
If you are using a *WeakHashMap* and your keys are boxed primitive types like, for example, an Integer with value 10, then you should *NOT* use "Integer.valueOf(10)" or even rely on autoboxing -- e.g., map.put(10, "blabla") -- to populate the keys of this map. REASON: both ".valueOf()" and autoboxing do a *caching* of primitive values (up to a t…
WeakHashMap<Integer, String> map = new WeakHashMap<Integer, String>();
map.put(new Integer(10), "aaa"); // remove entry
// map.put(10, "aaa"); // don't remove entry
// map.put(Integer.valueOf(10), "aaa"); // don't remove entry
for (int i = 0; i < Integer.MAX_VALUE; i++) {
if (map.size() != 0) {
System.out.println("At iteration " + i + " the map still holds the reference to object");
} else {
@hugocf
hugocf / bash.sh
Last active February 21, 2021 23:01
Moved to ➔ https://github.com/hugocf/scripts/blob/master/templates/bash.sh — Template for interactive bash scripts: supports command line options with values; prompts for any missing parameters/arguments.
#!/usr/bin/env bash
# Created by Hugo Ferreira <[email protected]> on isoD
# Licensed under the MIT License: https://opensource.org/licenses/MIT
set -u # treat unset variables as errors
readonly BASEDIR=$(cd "$(dirname "$0")" && pwd) # where the script is located
readonly CALLDIR=$(pwd) # where it was called from
readonly SUCCESS=0 # exit status of bash commands
_.extend Backbone.Validation.callbacks,
valid: (view, attr, selector) ->
control = view.$('[' + selector + '=' + attr + ']')
group = control.parents(".control-group")
group.removeClass("error")
if control.data("error-style") == "tooltip"
# CAUTION: calling tooltip("hide") on an uninitialized tooltip
# causes bootstraps tooltips to crash somehow...
control.tooltip "hide" if control.data("tooltip")
@LeaVerou
LeaVerou / dabblet.css
Created July 11, 2013 12:27
Attempt for Chrome-style progress-indicator with SVG and CSS animations
/**
* Attempt for Chrome-style progress-indicator with SVG and CSS animations
*/
@keyframes spin {
to {
stroke-dashoffset: -264;
}
}
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 5, 2025 13:05
A badass list of frontend development resources I collected over time.

An Elasticsearch in Crash Course!

By Andrew Cholakian

All examples use the Stretcher ruby gem

What is Elasticsearch?

  • An Information Retrieval (IR) System
  • A way to search your data in terms of natural language, and so much more
@azell
azell / Spring Txn and jOOQ 3.7.0
Last active April 11, 2020 19:05
Attempting to integrate Spring Transaction with jOOQ 3.7.0
public class SpringExceptionTranslationExecuteListener
extends DefaultExecuteListener {
/** {@inheritDoc} */
@Override
public void exception(ExecuteContext ctx) {
SQLException e = ctx.sqlException();
if (e != null) {
String name = ctx.configuration().dialect().thirdParty().springDbName();
Mac OSX keyboard layout switching is a pain in the ass.
Using a keyboard layout different than the one actually printed on
your keys is also weird. The following keyboard shortcuts allow you
to create the various diacritics used in languages like Portuguese
on the British layout of a Mac keyboard.
Alt+e -> ´ Examples: é ó á
Alt+i -> ^ Examples: â ê
Alt+c -> ç