Skip to content

Instantly share code, notes, and snippets.

View eliperelman's full-sized avatar

Eli Perelman eliperelman

View GitHub Profile
@eliperelman
eliperelman / jest.config.js
Last active March 11, 2022 11:54
SVG preset for Neutrino
// jest.config.js
const neutrino = require('neutrino');
process.env.NODE_ENV = process.env.NODE_ENV || 'test';
module.exports = neutrino().customJest();
@eliperelman
eliperelman / LICENSE.txt
Created June 21, 2011 13:21 — forked from 140bytes/LICENSE.txt
Array.prototype.some polyfill for 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Eli Perelman <http://eliperelman.com>
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
class Foo extends Component {
state = {
email: '',
password: '',
};
handleChange = e => {
this.setState({
[e.target.name]: e.target.value,
});
'use strict';
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
use: [
['@neutrinojs/airbnb', {
"eslint": {
"rules": {
"semi": ["off"],
// Restricting for..of seems pretty controversial, let's disable that.
@eliperelman
eliperelman / LICENSE.txt
Created August 16, 2011 06:09 — forked from 140bytes/LICENSE.txt
Throttling and Debouncing
DO WHAT THE **** YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Eli Perelman <http://eliperelman.com>
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 **** YOU WANT TO PUBLIC LICENSE
@eliperelman
eliperelman / LICENSE.txt
Created June 21, 2011 20:30 — forked from 140bytes/LICENSE.txt
Curry functions in JavaScript for 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Eli Perelman <http://eliperelman.com>
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
@eliperelman
eliperelman / LICENSE.txt
Created June 20, 2011 16:25 — forked from 140bytes/LICENSE.txt
Date.now polyfill for 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Eli Perelman http://eliperelman.com
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
@eliperelman
eliperelman / LICENSE.txt
Last active April 18, 2016 23:20 — forked from 140bytes/LICENSE.txt
Preloader140
DO WHAT YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Eli Perelman <http://eliperelman.com>
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 YOU WANT TO PUBLIC LICENSE
@eliperelman
eliperelman / LICENSE.txt
Created June 20, 2011 16:53 — forked from 140bytes/LICENSE.txt
String.prototype.trim polyfill for 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Eli Perelman http://eliperelman.com
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
@eliperelman
eliperelman / gist:1390043
Created November 23, 2011 21:57 — forked from garth/gist:1388969
Convert url image ref into inline base 64 in css with nodejs
var css = 'insert lots of css here';
var files = {};
css = css.replace(/url\((\S*)\.(png|jpg|jpeg|gif)\)/g, function(match, file, type)
{
var fileName = file + '.' + type;
var base64 = fs.readFileSync(fileName).toString('base64');
if (typeof(files[fileName]) !== 'undefined') {
console.log('Warning: ' + fileName + ' has already been base64 encoded in the css');
}