Skip to content

Instantly share code, notes, and snippets.

View jerolan's full-sized avatar

Jerome Olvera jerolan

View GitHub Profile
@jerolan
jerolan / webpack.config.js
Created April 26, 2016 05:06 — forked from learncodeacademy/webpack.config.js
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
@jerolan
jerolan / web-servers.md
Created June 18, 2016 17:18 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jerolan
jerolan / word_frequencies_top.txt
Created June 27, 2016 03:38 — forked from romainmet/word_frequencies_top.txt
Udacity Assessment Answer - Machine Learning Nanodegree
"""Count words."""
count={}
def count_words(s, n):
"""Return the n most frequently occuring words in s."""
wordlist = s.split()
wordfreq = [wordlist.count(p) for p in wordlist]
zip_l=dict(zip(wordlist,wordfreq))
sort=sorted(zip_l.iteritems(),key=lambda(k,v):(-v,k))

Swagger

Dockerfile

FROM node:4
RUN apt-get -y update && npm install -g coffee-script && npm install -g forever && npm install -g nodemon && npm install swagger -g

WORKDIR /app
# ADD package.json /app/
# ADD config.json /app/
# RUN npm install
@jerolan
jerolan / mocha.opts
Last active March 13, 2017 18:35
Basic mocha set up for bdd
--ui bdd
--reporter dot
-r test/helpers/setup
-w
-G
@jerolan
jerolan / setup.js
Created March 13, 2017 18:35
Basic chai set up for bdd
import chai from 'chai'
import chaiAsPromised from 'chai-as-promised'
import dotenv from 'dotenv'
import path from 'path'
chai.use(chaiAsPromised)
dotenv.config({
path: path.resolve(process.env.PWD, 'test', 'helpers', './.env')
})
// @remove-on-eject-begin
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
// @remove-on-eject-end
@jerolan
jerolan / firebase.js
Created June 7, 2017 18:45
My firebase elemental operations
import * as firebase from 'firebase'
if (!firebase.apps.length) {
firebase.initializeApp({
apiKey: 'your_api_key',
authDomain: 'your_auth_domain',
databaseURL: 'your_database_url',
projectId: 'your_project_ir',
storageBucket: 'your_storage_bucket',
messagingSenderId: 'your_messaging_sender_id'
{
"files.trimTrailingWhitespace": true,
"emmet.triggerExpansionOnTab": true,
"javascript.validate.enable": false,
"editor.renderWhitespace": "boundary",
"editor.tabSize": 2,
"editor.minimap.enabled": false,
"editor.tabCompletion": true,
"editor.fontLigatures": true,
"terminal.integrated.fontSize": 14,
@jerolan
jerolan / README-Template.md
Created November 28, 2017 18:57 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites