Skip to content

Instantly share code, notes, and snippets.

View ronbeltran's full-sized avatar

Ronnie Beltran ronbeltran

View GitHub Profile
#!/usr/bin/env python
# http://support.sugarcrm.com/02_Documentation/04_Sugar_Developer/Sugar_Developer_Guide_6.7/02_Application_Framework/Authentication/Oauth/
# pip install oauth2
import urllib
import urlparse
import oauth2 as oauth
SUGAR_INSTANCE_URL = 'REPLACE-WITH-YOUR-SUGAR-URL'
### My alias
alias cls='clear'
alias v='vim'
alias such='curl -I'
alias r='dev_appserver.py .'
alias serve='python -m SimpleHTTPServer 8888'
alias fab_stage='fab no_upload no_package no_hipchat stage'
alias up='echo pwd | appcfg.py --email=ronnie@collabspot.com --passin --no_cookies update'
alias down='echo pwd | appcfg.py --email=ronnie@collabspot.com --passin --no_cookies rollback'

Interactive Debugging in any Python Web Project

Ron DuPlain - PyOhio 2013

Turn this:

{% capture html %}
<ul>
{% if include.context == "/" %}
<li class="{% if page.url == "/" %}active{% endif %}">
<a href="{{ site.baseurl }}/">{{ site.title }}</a>
</li>
{% endif %}
{% assign entries = site.pages | sort: "path" %}
{% for entry in entries %}
{% extends 'base.html' %}
{% import 'macros.html' as macros %}
{% block content %}
<div class="row">
<div class="col-xs-12 col-md-3 col-sm-4 col-sm-offset-4 col-md-offset-4 col-lg-3 col-lg-offset-4">
<div class="login-message">
Login to AwesomeService!
</div>
{% call macros.render_form(form, action_url=url_for('login_view'), action_text='Login',
class_='login-form') %}
"""
The activation key for the ``UserProfile`` will be a
SHA1 hash, generated from a combination of the ``User``'s
email and a random salt.
"""
salt = hashlib.sha1(str(random.random())).hexdigest()[:5]
email = user.email
if isinstance(email, unicode):
@ronbeltran
ronbeltran / foo.log
Last active August 29, 2015 14:20 — forked from ibeex/foo.log
A warning occurred (42 apples)
An error occurred
Apache:
- Activated 'KeepAlive' connections
- Lowered keep alive timeout from 15 seconds to 2 seconds
- Increased the number of minimum workers from 8 to 16
- Activated server status page (/server-status)
APC (Alternative PHP Cache):
- Set cache size to 256MB (ideal for SugarCRM workload)
Memcache:

This is a post by Joel Spolsky. The original post is linked at the bottom.

This is such a common question here and elsewhere that I will attempt to write the world's most canonical answer to this question. Hopefully in the future when someone on answers.onstartups asks how to split up the ownership of their new company, you can simply point to this answer.

The most important principle: Fairness, and the perception of fairness, is much more valuable than owning a large stake. Almost everything that can go wrong in a startup will go wrong, and one of the biggest things that can go wrong is huge, angry, shouting matches between the founders as to who worked harder, who owns more, whose idea was it anyway, etc. That is why I would always rather split a new company 50-50 with a friend than insist on owning 60% because "it was my idea," or because "I was more experienced" or anything else. Why? Because if I split the company 60-40, the company is going to fail when we argue ourselves to death. And if you ju