Skip to content

Instantly share code, notes, and snippets.

View netoisc's full-sized avatar
🏠
Working from home

Ernesto netoisc

🏠
Working from home
View GitHub Profile
@netoisc
netoisc / 0_reuse_code.js
Last active August 29, 2015 14:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@netoisc
netoisc / css_resources.md
Last active August 29, 2015 14:23 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@netoisc
netoisc / python_resources.md
Last active August 29, 2015 14:23 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@netoisc
netoisc / javascript_resources.md
Last active August 29, 2015 14:23 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@netoisc
netoisc / python.jinja2.alternating_rows.html
Created December 15, 2015 22:22
How to alternate row style in jinja2
<ul>
{% for row in rows %}
<li class="{{ loop.cycle('odd', 'even') }}">{{ row }}</li>
{% endfor %}
</ul>
@netoisc
netoisc / python.jinja2.accessingParentLoop.html
Created December 16, 2015 22:56
Accessing the parent loop inside a bucle
<table>
{% for row in table %}
<tr>
{% set rowloop = loop %}
{% for cell in row %}
<td id="cell-{{ rowloop.index }}-{{ loop.index }}">{{ cell }}</td>
{% endfor %}
</tr>
{% endfor %}
</table>
# 1 - Modify Vagrantfile in order to allow portforwarding
config.vm.network "forwarded_port", guest: 5432, host: 7001
# 2-Edit postgresql.conf (Guest)
listen_addresses = '*'
#3 -Edit pg_hba.conf (you might want to tune this better)
@netoisc
netoisc / flask_ecs_extension.py
Created August 25, 2016 18:43
A helper class that uses AWS ECS to launch tasks
import boto3
import logging
class ECS:
"""
Class to launch and manage notebook containers
"""
def __init__(self, app=None):
"""
@netoisc
netoisc / SaxonJS.min.js
Created May 24, 2017 19:17
Use saxon-js to generate html (with interactions) from a xml and a xls
var SaxonJS=function(){function showValue(t){"use strict";if(null===t)return"#null";if("undefined"==typeof t)return"#undefined";var e;if(t instanceof Expr.XdmArray){e="[";var r;for(r=0;r<t.value.length&&3>r;r++)0!==r&&(e+=","),e+=showValue(t.value[r]);return t.value.length>=4&&(e+=",...("+t.value.length+")"),e+="]"}if(t instanceof HashTrie)return e="{",t.forAllPairs(function(t){e+=showValue(t.k),e+=": ",e+=showValue(t.v),e+=", "}),e+="}";if(!DomUtils.isNode(t)||DomUtils.isAttr(t)||DomUtils.isNSNode(t)){if(DomUtils.isAttr(t))return"attribute @"+t.name;if(DomUtils.isNSNode(t))return"ns:"+t.prefix+"="+t.uri;if(t.type)return"string"===t.type?'"'+t.toString()+'"':"integer"===t.type||"boolean"===t.type?t.toString():"xs:"+t.type+"("+t.toString()+")";if("object"==typeof t&&"length"in t){e="(";var n;for(n=0;n<t.length&&3>n;n++)0!==n&&(e+=","),e+=showValue(t[n]);return t.length>=4&&(e+=",...("+t.length+")"),e+=")"}return"??? "+t}if(e={1:"element <"+t.tagName+">",2:"attribute @"+t.name,3:"text",7:"pi",8:"comment",9:"do
@netoisc
netoisc / babel.js
Created June 7, 2017 23:44
Use context in React to propagate global variables (like settings)
class User extends React.Component {
// getChildContext serves as the initializer for our context values
getChildContext() {
return {
favColor: '#f8c483',
userName: 'James Ipsum'
}
}
render() {