Skip to content

Instantly share code, notes, and snippets.

View Jwpe's full-sized avatar
🌲
Work

Jonathan Evans Jwpe

🌲
Work
View GitHub Profile
@Jwpe
Jwpe / mentoring.md
Created August 27, 2015 15:27
Notes from Rachel Ober's guide to developer mentoring
  • Best mentoring experience is a two-way street

How to get started with mentoring?

  • Talk to others and find out who would be interested in the process
  • Is this for engineering, or the whole company
  • Start a pilot program
  • Ask HR about it

What stops people mentoring?

  • Fear of doing it badly
@Jwpe
Jwpe / onboarding.md
Last active August 27, 2015 15:05
Notes from Kate Heddleston's onboarding description

Why she got involved in onboarding

  • Noticed guys get promoted faster
  • Without onboarding, women got left behind

Why is onboarding important?

  • Spend a lot of money on recruiting, but then throw people in the deep end
  • Extremely high ROI

Who should mentor?

  • Pretty much everyone should be involved in onboarding
@Jwpe
Jwpe / ssh_agent_start.fish
Last active August 29, 2015 14:04 — forked from schaary/ssh_agent_start.fish
Activate ssh_agent in Fish
function start_agent
echo "Initializing new SSH agent ..."
ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV
echo "succeeded"
chmod 600 $SSH_ENV
. $SSH_ENV > /dev/null
ssh-add
end
function test_identities
@Jwpe
Jwpe / models.py
Last active August 29, 2015 14:01
Generating a rendered HTML field from a Markdown field on a model
from django.db import models
import markdown
class Blog(models.Model):
content = models.TextField()
_html = models.TextField()
def save(self, *args, **kwargs):
@Jwpe
Jwpe / urls.py
Created May 19, 2014 05:24
Use a random URL path for the Django admin interface
from django.conf import settings
from django.conf.urls.defaults import patterns, include, url
from django.contrib import admin
# Tells the admin to discover any 'admin.py' files in your apps. Not necessary in Django 1.7+
admin.autodiscover()
urlpatterns = patterns('',
url(r'^{}/admin/'.format(settings.ADMIN_URL_PATH), include(admin.site.urls)),
...
@Jwpe
Jwpe / settings.py
Created May 19, 2014 05:17
Pull in an admin URL path to Django settings from an environment variable
import os
...
# Admin URL path for obfuscating the admin interface
ADMIN_URL_PATH = os.environ.get('ADMIN_URL_PATH')
@Jwpe
Jwpe / uuid.py
Created May 19, 2014 05:14
Make a random UUID in Python
import uuid
# UUID4 is random!
my_uuid = uuid.uuid4()
@Jwpe
Jwpe / markdown_filter.py
Last active August 8, 2016 03:40
Markdown template filter in Django 1.5+
from django import template
import markdown
register = template.Library()
@register.filter
def markdownify(text):
# safe_mode governs how the function handles raw HTML
return markdown.markdown(text, safe_mode='escape')
@Jwpe
Jwpe / api.py
Last active August 29, 2015 13:59
Contact an API using requests!
# Here we import the 'requests' library. This allows us to visit URLs
# straight from Python. Note that this must be installed using pip,
# as described in the previous post
import requests
# We define a variable which represents the URL we want to get data from
api_url = 'http://api.crunchbase.com/v/1/company/trackmaven.js'
# Next we make a dictionary of parameters that are needed to contact the
# API - in this case, all we need is the key that tells the API we are