Skip to content

Instantly share code, notes, and snippets.

View briandant's full-sized avatar

Brian Dant briandant

View GitHub Profile
@briandant
briandant / managing-submodules.md
Last active August 29, 2015 14:01
How to manage submodules

Git Submodules

Notes on how to work with submodules. superproject here would be commcare-hq root.

Get changes from remote

git checkout master
git pull origin master

Next: Tell git to register and checkout the proper commits in submodules. Commits are pulled into submodules in detached HEAD state.

@briandant
briandant / 0_reuse_code.js
Created June 6, 2014 02:04
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
@briandant
briandant / bd-twisted-error
Created September 20, 2012 02:28
Twisted error from python setup.py develop
### Error Output ###
Downloading http://pypi.python.org/packages/source/T/Twisted/Twisted-12.2.0.tar.bz2#md5=9a321b904d01efd695079f8484b37861
Processing Twisted-12.2.0.tar.bz2
Writing /tmp/easy_install-ftgyUB/Twisted-12.2.0/setup.cfg
Running Twisted-12.2.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ftgyUB/Twisted-12.2.0/egg-dist-tmp-AgVk9z
twisted/runner/portmap.c:10:20: error: Python.h: No such file or directory
twisted/runner/portmap.c:14: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
twisted/runner/portmap.c:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
twisted/runner/portmap.c:45: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PortmapMethods’
# This is the Dockerfile that manages the edX --> Cloud9 connection.
FROM kdelfour/cloud9-docker
RUN mkdir -p /edx/app/edxapp && ln -s /workspace /edx/app/edxapp
VOLUME /edx/app/edaxapp
from django.cotrib.staticfiles.storage import CachedFilesMixin
class ASCachedFilesMixin(CachedFilesMixin):
"""A Cached files mixin that handles slashes properly, so that we can use
Pipeline with ``url(//fonts.google.com//*)``.
"""
def url_converter(self, name):
"""
@briandant
briandant / gist:5457321
Created April 25, 2013 03:33
Some simple views for updating Django models
# views.py
from models import Recipe
# create a new recipe
def create_recipe(request, template='successful_recipe_add.html"):
recipe_title = request.POST['title'] # request.POST is a dict that comes from your form; the keys of request.POST will come from the name attribute of your HTML <input> element
recipe_description = request.POST['description']
recipe_content = reqeust.POST['content']
# etc, etc
@briandant
briandant / Team Almond Git Flow
Created May 18, 2013 15:10
This is what you'll need to do to set up proper pull requests for the Team Almond (sim) project. We're using a similar workflow as Team Jellybean. Ethan from their team created an excellent walkthrough on the workflow we'll use: https://github.com/esoergel/meta/wiki/Git-Walkthrough Read through that, and then set up your `remotes` based on the g…
$ git remote add almond git@github.com:CodeRaising/sim.git
# command to show your remotes
$ git remote
# what you should see
almond # this is the main `sim` repo
origin # this is your GitHub repo (the one that you forked)
Host prod-isc-wharf
HostName isc.appsembler.com
Port 22
User root
Host prod-isc-docker
HostName 45.55.236.164
Port 22
User root
Host prod-isc-docker-2
HostName 45.55.239.148