Skip to content

Instantly share code, notes, and snippets.

Eric Feminella efeminella

Block or report user

Report or block efeminella

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@efeminella
efeminella / reyarn.sh
Last active Jul 12, 2018
Simple Bash script which cleans yarn cache / node_modules dir and reinstalls
View reyarn.sh
#!/bin/bash
# Simple Bash script which cleans yarn cache / node_modules dir and reinstalls
# Source it from .bashrc, and run from dir $ reyarn
function reyarn() {
local BEGIN='\x1B[33m[BEGIN]: ';
local SUCCESS='\x1B[32m[SUCCESS]: ';
local FAILURE='\x1B[31m[FAILURE]: ';
local CLEAR='\x1B[0m';
printf '\n\n';
@efeminella
efeminella / killvpn
Created Apr 2, 2013
Kill Cisco VPN process (useful for which would otherwise require a system restart).
View killvpn
function killvpn() {
ps -ef | grep racoon | grep -v grep | awk '{print $2}' | xargs kill -9
}
@efeminella
efeminella / killds
Created Apr 2, 2013
Recursively delete all (ever annoying) .DS_Store files.
View killds
function killDs() {
find . -name ".DS_Store" -exec rm -rf {} \;
}
@efeminella
efeminella / ios-html5-input-element-tips.html
Last active Feb 27, 2017
An example which demonstrates how to override default behaviors of the iOS Keyboard for Mobile Web Applications.
View ios-html5-input-element-tips.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>iOS HTML5 input element Example</title>
<meta name="author" content="Eric Feminella" />
<script src="http://code.jquery.com/jquery.min.js"></script>
<style>
@efeminella
efeminella / compress.js
Created Dec 16, 2012
Simple node program for js/css minification using yuicompressor
View compress.js
/*
* basic node program for js/css minification using yuicompressor
*
* Compress the file test.js:
* $ node compress.js ../js/test.js
* Created Minified File: ../js/test.min.js
*
* Compress the file test.css
* $ node compress.js ../css/test.css
* Created Minified File: ../css/test.min.css
@efeminella
efeminella / backbone-persistable-collection.js
Created Apr 9, 2012
A Persistable Backbone Collection Implementation
View backbone-persistable-collection.js
/*!
* Copyright (c) 2012 Eric Feminella, http://code.ericfeminella.com/license/LICENSE.txt
*/
( function( _, Backbone )
{
// convenience reference to the Backbone.Collection constructor
var _initialize = Backbone.Collection.prototype.initialize;
/*
* The Backbone.PersistableCollection provides a simply abstraction which
@efeminella
efeminella / data.point.adapter.js
Created Apr 3, 2012
A Highcharts Data Point Adapter for Backbone Models
View data.point.adapter.js
/*
* Defines a Model which adapts the representation of the relationship
* between two variables defined as x and y, to specific named properties
* which represent 'x' and 'y'.
*
* For example, a data point which models Temperature may represent time
* on the x-axes as x, and degrees on the y-axes as y. A Model can extend
* DataPoint to map x and y to their corresponding named properties defined
* as time and degrees, respectively.
*
@efeminella
efeminella / gist:2048192
Created Mar 16, 2012
Short-hand convenience functions for Jasmine and jasmine-jquery
View gist:2048192
// Short-hand convenience functions for Jasmine and jasmine-jquery
/*
* Shorthand convenience for:
*
* expect( $( '#some-id' ) ).toHaveClass( 'someClassName' );
* expectClass( '#some-id', 'someClassName');
*/
var expectClass = function( selector, className )
@efeminella
efeminella / enhance.helper.js
Created Mar 14, 2012
Plain text URL to anchor tags Handlebars Helper
View enhance.helper.js
// Plain text URL to anchor tags Handlebars Helper
(function(){
// defines markup enhancement regex
var protocol = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim
, scheme = /(^|[^\/])(www\.[\S]+(\b|$))/gim;
/*
* Registers a Helper method with handlebars which, given a string of
* plain text or existing markup, provides enhancements of plain text
View Adjacent sibling combinator
/* Matches all <em> elements which are the next sibling of a <strong> element */
strong + em {
    /* declarations */
}
You can’t perform that action at this time.