Skip to content

Instantly share code, notes, and snippets.

View aj07mm's full-sized avatar

Julio Marins aj07mm

View GitHub Profile
@aj07mm
aj07mm / filters.py
Created January 18, 2017 20:08 — forked from sehmaschine/filters.py
OrderingFilter for Django Rest Framework
# coding: utf-8
# PYTHON IMPORTS
from django.utils import six
from django.core.exceptions import ImproperlyConfigured
# REST IMPORTS
from rest_framework.settings import api_settings
from rest_framework.filters import BaseFilterBackend
@aj07mm
aj07mm / HowToSharedRepoModelOnGitHub.md
Created October 21, 2016 03:35 — forked from seshness/HowToSharedRepoModelOnGitHub.md
Shared Repository Model for Pull Requests and Code Review

The Shared Repository Model

$ git clone [email protected]:berkeley-food-recommendations/data-gathering.git

You're cloning the main repository - be careful! We're going to enforce a "no committing to master directly" rule, so no committing directly to master, please.

Short Version

@aj07mm
aj07mm / haystack.sh
Created June 24, 2016 14:38 — forked from toastdriven/haystack.sh
haystack.sh
#!/bin/sh
# First, open up GitX
cd ~/Code/Python/django-haystack; gitx
tmux start-server
tmux new-session -d -s Haystack -n git
tmux new-window -tHaystack:1 -n test
tmux new-window -tHaystack:2 -n solr
tmux new-window -tHaystack:3 -n docs
tmux new-window -tHaystack:4 -n runserver
@aj07mm
aj07mm / show-clicked-row-details-right-way.md
Created June 5, 2016 22:33 — forked from umidjons/show-clicked-row-details-right-way.md
Show clicked row details. Using ng-switch, ng-click, ng-class, ng-repeat, $index.

Show clicked row details. Using ng-if, ng-repeat-start and ng-repeat-end directives

<!doctype html>
<html lang="en-US" ng-app="App">
<head>
	<meta charset="UTF-8">
	<script src="angular.js"></script>
	<title>Users</title>

#Create bitbucket branch

##Create local branch

$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
  master
* sync
@aj07mm
aj07mm / tmux-cheatsheet.markdown
Created April 27, 2016 20:42 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@aj07mm
aj07mm / gist:1997fd995c52c40f5a3369ccf8b89013
Created April 26, 2016 19:07 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@aj07mm
aj07mm / git-branches-by-commit-date.sh
Created April 14, 2016 13:26 — forked from l15n/git-branches-by-commit-date.sh
List remote Git branches and the last commit's author and author date for each branch. Sort by most recent commit's author date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ai %ar by %an" $branch | head -n 1` \\t$branch; done | sort -r
@aj07mm
aj07mm / bling.js
Created March 24, 2016 16:36 — forked from paulirish/bling.js
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@aj07mm
aj07mm / web-servers.md
Created February 18, 2016 13:32 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000