Skip to content

Instantly share code, notes, and snippets.

View ErikCupal's full-sized avatar
:octocat:
...

Erik Cupal ErikCupal

:octocat:
...
View GitHub Profile
@ErikCupal
ErikCupal / slim-redux.js
Created December 23, 2016 21:51 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@ErikCupal
ErikCupal / androidLambdas.java
Last active January 26, 2017 17:33
Android event handlers using Java 8 lambdas
// Old Java
button.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
//TODO: Downloadd everything
return true;
}
});
@ErikCupal
ErikCupal / some-random-css.css
Last active April 8, 2017 16:06
Some random CSS (and HTML)
table { // it would be better to use a class
overflow-x: auto; // allow horizontal scrolling if needed
display: block;
}
////////////////
<head>
<title> Database</title>
@ErikCupal
ErikCupal / some-html-css-573.html
Created April 9, 2017 15:48
some html & css 573
<style>
.light-gray-button {
padding: 5px 15px;
border: 2px solid transparent;
border-radius: 3px;
text-align: center;
cursor: pointer;
user-select: none;
white-space: nowrap;
color: #fff;