Skip to content

Instantly share code, notes, and snippets.

View Calamari's full-sized avatar
💭
Available for Work

Calamari

💭
Available for Work
View GitHub Profile
@Calamari
Calamari / asyncHelpers.js
Last active February 17, 2018 11:04
page helpers for async waiting
const sleep = time => new Promise(resolve => {
setTimeout(() => resolve(), time)
})
const waitUntilHidden = async (selector, timeout = 5000) => {
const endTime = Date.now() + timeout
while (document.querySelectorAll(selector).length && Date.now() < endTime) {
await sleep(100)
}
}
@Calamari
Calamari / install.sh
Created October 13, 2016 08:12
React JSDom testing (without Karma) but with coverage
npm install --save-dev babel-cli babel-core babel-plugin-__coverage__ enzyme chai-enzyme jsdom-global mocha-jsdom nyc
@Calamari
Calamari / .babelrc
Last active August 25, 2016 16:48
Webpack, Karma, jasmine, react Boilerplate
{
"presets": ["es2015", "react"],
"plugins": [
"add-module-exports",
"transform-object-rest-spread",
"transform-class-properties",
"transform-flow-strip-types"
]
}
@Calamari
Calamari / Postgres install
Created August 8, 2013 19:10
How to install postgres on mac (incl. creating a user and a database)
# Install Postgres on mac
Install it
``` bash
brew install postgres
initdb /usr/local/var/postgres -E utf8
```
Start database
@Calamari
Calamari / blurred.css
Created July 18, 2013 20:51
Making a CSS3 only blur effect
/**
* Making a CSS3 only blur effect
*/
.blurred {
-webkit-filter: blur(4px);
/* These are not implemented yet: */
-moz-filter: blur(4px);
-ms-filter: blur(4px);
filter: blur(4px);
@Calamari
Calamari / minimal-scriptloader.js
Created March 1, 2013 22:02
Minimal JavaScript loader
(function(win) {
"use strict";
win.jaz = win.jaz || {};
win.jaz.scriptLoader = function(src, cb) {
var script = document.createElement('script');
script.src = src;
script.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(script);
script.onload = cb;
};
@Calamari
Calamari / LICENSE.txt
Created August 4, 2011 09:12 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@Calamari
Calamari / LICENSE.txt
Created July 29, 2011 19:55 — forked from 140bytes/LICENSE.txt
140byt.es - Prime Number Tester
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE