Skip to content

Instantly share code, notes, and snippets.

View eddywashere's full-sized avatar
🔥
loading...

Eddy Hernandez eddywashere

🔥
loading...
View GitHub Profile
@ryanflorence
ryanflorence / badjs.md
Created November 7, 2011 04:52
What leads to a poor JavaScript application?

What makes a bad JavaScript application?

We've all seen some horrible JavaScript. Name the top five things you see that lead to horrible JavaScript applications. Feel free to elaborate on each of your points.

I'll start, in no particular order:

  1. Poor organization in the file system
  2. Poor abstraction
  3. Seemingly endless indentation in nested callbacks / if / else if / etc.
@javan
javan / sl2-setup.md
Created July 23, 2012 14:47
My Sublime Text 2 setup
@chrisjaure
chrisjaure / deploy.js
Created July 29, 2012 17:16
Deploying nodejs apps with haibu and git
#! /path/to/node
var haibu = require('/path/to/haibu');
var client = new haibu.drone.Client();
process.stdin.resume();
process.stdin.on('data', function(data){
var package = JSON.parse(data.toString());
@eddywashere
eddywashere / html5boilerplate.jade
Created November 11, 2012 22:06 — forked from xtian/html5boilerplate.jade
HTML5 Boilerplate in jade
!!! 5
//if lt IE 7
<html class="no-js lt-ie9 lt-ie8 lt-ie7">
//if IE 7
<html class="no-js lt-ie9 lt-ie8">
//if IE 8
<html class="no-js lt-ie9">
//[if gt IE 8]><!
html(class='no-js')
//<![endif]
@arielsalminen
arielsalminen / nav.html
Last active December 14, 2015 12:18
Simple responsive navigation toggle script without library dependencies and with touch screen support (349 bytes minified and gzipped). Live demo: http://codepen.io/viljamis/full/gAatl
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<title>Nav toggle</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
<ol id="nav" class="closed">
<li class="active"><a href="#">Home</a></li>
@afshinm
afshinm / example-connection.js
Created April 5, 2013 11:03
Example of MongoDb singleton connection
var mongoDbConnection = require('./lib/connection.js');
exports.index = function(req, res, next) {
mongoDbConnection(function(databaseConnection) {
databaseConnection.collection('collectionName', function(error, collection) {
collection.find().toArray(function(error, results) {
//blah blah
});
});
});
function createDisabledUntilClientRendersComponent(component, displayName='ClientComponent') {
return React.createClass({
displayName,
propTypes: {
disabled: React.PropTypes.bool
},
getInitialState() {
@lambtron
lambtron / sorter.js
Created October 20, 2015 17:27
Custom sort method for metalsmith-collections plugin in Segment's technical documentation.
/**
* Generate a custom sort method for given starting `order`. After the given
* order, it will ignore casing and put periods last. So for example a call of:
*
* sorter('Overview');
*
* That is passed:
*
* - Analytics.js
@joepie91
joepie91 / delay.js
Last active September 19, 2016 19:11
Bluebird Promise.delay for ES6 Promises
var Promise = require("es6-promise").Promise;
module.exports = function(delay){
return function(value) {
return new Promise(function(resolve, reject){
setTimeout(function(){
resolve(value);
}, delay)
});
}
@JamieMason
JamieMason / protractor_members.txt
Created July 4, 2013 09:52
Methods available to you in a Jasmine test using https://github.com/juliemr/protractor/
protractor.wrapDriver
protractor.setInstance
protractor.getInstance
protractor.By
protractor.By.binding
protractor.By.select
protractor.By.selectedOption
protractor.By.input
protractor.By.repeater