Skip to content

Instantly share code, notes, and snippets.

@mrjoes
mrjoes / ckedit.py
Created March 18, 2013 19:04
Flask-Admin and CKEditor WYSIWYG textarea integration. Basically, all you have to do: 1. Create new wtforms widget which will emit 'ckeditor' class 2. Make new wtforms field which will use this widget 3. Create new jinja2 template, which includes ckeditor javascript 4. Tell flask-admin to use new field and new template
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext import admin, wtf
from flask.ext.admin.contrib import sqlamodel
app = Flask(__name__)
app.config['SECRET_KEY'] = '123456790'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///test.sqlite'
db = SQLAlchemy(app)
@guinunez
guinunez / syncme.sh
Last active January 30, 2023 23:02
Herramienta para realizar los comandos mas comunes de git en secuencia:- Verifica que esté sobre un repositorio- Agrega y quita los archivos modificados- Hace el commit pidiendo el mensaje- Realiza el pull- Si detecta un branch remoto upstream, hace el merge- Si el automerge falla, llama a mergetool (hay que volver a correr syncme despues de eso…
#!/usr/bin/env bash
# Tool to perform common Git commands in sequence:
# - Verifies that you are in a Git repository
# - Adds and removes modified files
# - Commits with a message
# - Performs a pull
# - If a remote upstream branch is detected, performs a merge
# - If the automatic merge fails, calls the mergetool (you need to run syncme again after that)
@wting
wting / dreamhost_python_setup.sh
Created May 31, 2012 00:16
Dreamhost Python Setup script
#!/usr/bin/env bash
# Written by William Ting for the following blog post:
# http://williamting.com/posts/2012/04/18/set-up-python-and-django-on-dreamhost/
rcfile="${HOME}/.bashrc"
version="2.7.3"
setuptools_version="2.7"
tmp_dir="${HOME}/tmp-${RANDOM}"
if [[ ${#} == 0 ]]; then
@insin
insin / bash_prompt.sh
Created December 3, 2011 01:49 — forked from woods/git_svn_bash_prompt.sh
Set color bash prompt according to active virtualenv, git branch and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.