Skip to content

Instantly share code, notes, and snippets.

View efeminella's full-sized avatar

Eric Feminella efeminella

View GitHub Profile
@efeminella
efeminella / reyarn.sh
Last active July 12, 2018 15:21
Simple Bash script which cleans yarn cache / node_modules dir and reinstalls
#!/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 April 2, 2013 17:03
Kill Cisco VPN process (useful for which would otherwise require a system restart).
function killvpn() {
ps -ef | grep racoon | grep -v grep | awk '{print $2}' | xargs kill -9
}
@efeminella
efeminella / killds
Created April 2, 2013 17:01
Recursively delete all (ever annoying) .DS_Store files.
function killDs() {
find . -name ".DS_Store" -exec rm -rf {} \;
}
@efeminella
efeminella / ios-html5-input-element-tips.html
Last active February 27, 2017 07:44
An example which demonstrates how to override default behaviors of the iOS Keyboard for Mobile Web Applications.
<!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 December 16, 2012 01:23
Simple node program for js/css minification using yuicompressor
/*
* 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 April 9, 2012 21:10
A Persistable Backbone Collection Implementation
/*!
* 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 April 3, 2012 22:10
A Highcharts Data Point Adapter for Backbone Models
/*
* 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 March 16, 2012 02:41
Short-hand convenience functions for Jasmine and jasmine-jquery
// 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 March 14, 2012 04:57
Plain text URL to anchor tags Handlebars Helper
// 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
/* Matches all <em> elements which are the next sibling of a <strong> element */
strong + em {
    /* declarations */
}