Skip to content

Instantly share code, notes, and snippets.

View jstacoder's full-sized avatar
:octocat:
working

Kyle J. Roux jstacoder

:octocat:
working
View GitHub Profile
@jstacoder
jstacoder / javascript_resources.md
Last active August 29, 2015 14:13 — 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
@jstacoder
jstacoder / css_resources.md
Last active August 29, 2015 14:13 — 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

@jstacoder
jstacoder / manage.py
Created January 14, 2015 04:13
flask_script - gather_templates command (like djangos management command, but for flask)
from flask import Flask
from flask_script import Manager
from flask_admin import Admin
import os.path as op
import os
app = Flask(__name__)
manager = Manager(app)
admin = Admin(app) #<-- this gives our app some templates to gather
@jstacoder
jstacoder / angularapp.py
Last active June 1, 2023 11:14
flask / angular example (underscores in filenames mean directorys)
from flask import Flask
from flask import render_template
app = Flask(__name__)
app.url_map.strict_slashes = False
@app.route('/partials/<partial>')
def partial(partial):
return render_template(partial,jinja_var='this is from jinja')
@jstacoder
jstacoder / _tables.py
Last active February 10, 2017 23:53
fun with python lambdas, print database tables and columns with a single line function using lambdas and sqlalchemy
print_tables =\
lambda\
BaseModel:\
''.join(
map(
lambda x:\
'\n{}\n{}\n'.format(
x[0],
x[1].__table__.c.keys()
),filter(
@jstacoder
jstacoder / alert.html
Last active April 13, 2018 02:55
example of integrating mongoengine with flask
{% for cat,msg in get_flashed_messages(with_categories=true) %}
<div class="alert alert-dissmissable alert-{{ cat }}" id="alert-{{ loop.index }}">
<span id="close-alert-{{ loop.index }}" class=close>x</span>
{{ msg }}
</div>
<script>
var alert = document.getElementById('alert-{{ loop.index }}'),
closeBtn = document.getElementById('close-alert-{{ loop.index }}');
closeBtn.onClick = function(){
alert.remove();
@jstacoder
jstacoder / git_clone.py
Last active August 29, 2015 14:25
easily clone github repos
#!/usr/bin/env python
import commands
import sys
from functools import partial
CMD = 'git clone {protocol}{sep1}github.com{sep2}{user}/{repo}.git'
make_cmd = lambda **kwargs: CMD.format(**kwargs)
ssh = partial(make_cmd,protocol='git',sep1='@',sep2=':')
https = partial(make_cmd,protocol='https',sep1='://',sep2='/')
So22222222222222222222222222222o2SoSoeinSo22222*3oSoSo22222222222oSoSo2oSoSoSoSo
22222222o22222o2222o222221I*11I|I**Xl|+i**|I1i|+|II1*I12222oo2222oo222o2o222o2o2
22o22222o22222o2222o22222n||+|+|++||=|+|+|+=||+|+|+|+||*1o222222ooSo22o222222oSo
22o222o2o222o2oo2o2ooo*1||+|+|++|+|+|+|++|+||++|++|+|+|+|||I*2o22oo222oo22o2o2o2
22o22o22o22o22o22o*1|||+++|++|+|+|++|++|+|+++|+|+|+++|++|=|+||iooo222o2o2222o222
22222222o22222oeii||+|+|+|+|||+|++|+||+|+||||+||+|+||+|+|+|+||*Soo2222o222222o22
222o2222oSo222o1||++|+||||||||||||||||||||||||||||||||||++|++|+|*n2222oo2222o222
22oSoSo2o22221i|++|++|||||||||||||||||||||||||||||||||||||+|++|++|*So2o222222222
2ooooooooooeii||+|+|||||||i|i|i|||||||||||||||||||||i|||||||||++|iisvooooooooooo
22222222222ool=|++||||||>=::::::::+++++i|+++++++==;::=<||||||+|+|+i1222oSoS22222
@jstacoder
jstacoder / get_pdfs.py
Last active January 13, 2016 05:28
download files from it-ebooks.info, from the command line
# requires twill==0.9
import sys
from twill import get_browser
from pprint import pprint
class PdfFinder:
browser = None
_b = None
_q = None
links = {}
@jstacoder
jstacoder / ace_editor_field.py
Created April 25, 2017 23:11
ace editor field and widget class to use ace editor inside projects using wtforms
from wtforms import fields
class AceEditorWidget(object):
def __init__(self,mode='python',theme='twilight'):
self.theme = theme
self.mode = mode
self.custom_css = '<style>#editor { width: 100%; }</style>'
self.theme_js = 'editor.setTheme("ace/theme/{theme}");'.format(theme=self.theme)
self.mode_js = 'editor.setOption("mode","ace/mode/{mode}");'.format(mode=self.mode)
self.js = '''