Open ~/.bash_profile
in your favorite editor and add the following content to the bottom.
# Git branch in prompt.
parse_git_branch() {
javascript: | |
document.querySelectorAll('.load-diff-button').forEach(node => node.click()) |
import unittest2 | |
import logging | |
import findspark | |
findspark.init() | |
from pyspark.context import SparkContext | |
class ExampleTest(unittest2.TestCase): | |
def setUp(self): |
from fabric.api import env, run, sudo, local, runs_once | |
# Uncomment this two lines if you need debug mode | |
# import paramiko | |
# paramiko.common.logging.basicConfig(level=paramiko.common.DEBUG) | |
# gce conf | |
GCE_PROJECT = 'my-project' | |
GCE_ZONE = 'europe-west1-b' | |
GCE_HOSTMATCH = 'frontend.*' | |
GCE_GS_URL = 'gs://bucket/dir/' |
{ | |
// http://eslint.org/docs/rules/ | |
"ecmaFeatures": { | |
"binaryLiterals": false, // enable binary literals | |
"blockBindings": false, // enable let and const (aka block bindings) | |
"defaultParams": false, // enable default function parameters | |
"forOf": false, // enable for-of loops | |
"generators": false, // enable generators | |
"objectLiteralComputedProperties": false, // enable computed object literal property names |
/* Useful celery config. | |
app = Celery('tasks', | |
broker='redis://localhost:6379', | |
backend='redis://localhost:6379') | |
app.conf.update( | |
CELERY_TASK_RESULT_EXPIRES=3600, | |
CELERY_QUEUES=( | |
Queue('default', routing_key='tasks.#'), |
from celery import chain | |
from django.core.management.base import BaseCommand | |
from . import tasks | |
class Command(BaseCommand): | |
def handle(self, *args, **kwargs): |
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.