Skip to content

Instantly share code, notes, and snippets.

View eliperelman's full-sized avatar

Eli Perelman eliperelman

View GitHub Profile
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
pids
package com.eliperelman.plugins.headsup;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
public class main extends JavaPlugin implements Listener {
@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(this, this);
}
@eliperelman
eliperelman / file.js
Created August 23, 2013 19:01
JavaScript Regex replace all lines that don't contain string
/^(?:(?!TOKEN).)*$[\r\n]/igm
var siteRoutes = {
'login': 'layouts/login',
'index': 'layouts/site'
};
App.ApplicationView = Ember.View.extend({
layoutName: function () {
var currentPath = this.get('controller.currentPath');
if (siteRoutes[currentPath]) {
@eliperelman
eliperelman / LICENSE.txt
Created June 17, 2011 15:37 — forked from 140bytes/LICENSE.txt
140byt.es polyfill for Array.filter
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 / 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');
}
@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 / 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: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
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