This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#form').submit(function() { | |
payload = $(this).serialize(); | |
$.ajax({ | |
url: 'http://', | |
type: 'POST', | |
data: payload, | |
dataType: 'jsonp' | |
success: function(data){ | |
// present success message here | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Welcome to github candidate finder! | |
Note: Current github api hardcode limit for searches is 1000 results | |
Valid arguments are either: | |
a. set the CREDS tuple in the code or, | |
b. pass one of the following: | |
* A github OAUTH_TOKEN | |
* A valid set of credentials (<Username>, <Password>) with which we'll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2015 Pavel Savshenko | |
* Copyright (C) 2011 Google Inc. All rights reserved. | |
* Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | |
* Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | |
* Copyright (C) 2009 Joseph Pecoraro | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A custom type for argparse, to facilitate validation of email addresses. | |
Inspired by this SO question: http://stackoverflow.com/questions/14665234/argparse-choices-structure-of-allowed-values | |
and this gist: https://gist.github.com/gurunars/449edbccd0de1449b71524c89d61e1c5 | |
""" | |
import re | |
import argparse | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Convert a Django HTTPRequest object (or dictionary of such a request) into a | |
cURL command. | |
""" | |
import json | |
import sys | |
required_fields = ['META', 'META.REQUEST_METHOD', 'META.SERVER_NAME', 'META.PATH_INFO'] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# based on https://gist.github.com/blueyed/4fb0a807104551f103e6 | |
# and on https://gist.github.com/TauPan/aec52e398d7288cb5a62895916182a9f (gistspection!) | |
from django.core.management import call_command | |
from django.db import connection | |
from django.db.migrations.executor import MigrationExecutor | |
import pytest | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Add copy to clipboard from IPython! | |
To install, just copy it to your profile/startup directory, typically: | |
~/.ipython/profile_default/startup/ | |
Example usage: | |
%clip hello world | |
# will store "hello world" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Callable, NamedTuple, Tuple | |
# class RuleDefinition(NamedTuple): | |
# pattern: str | |
# path: str | |
# check: Callable | |
RuleDefinition = Tuple[str, str, Callable] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from celery import Celery | |
app = Celery( | |
'my_app', | |
broker='pyamqp://guest@localhost:5673//', | |
backend='redis://localhost', | |
) | |
app.conf.worker_prefetch_multiplier = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Copyright 2001-2002 by Vinay Sajip. All Rights Reserved. | |
# | |
# Permission to use, copy, modify, and distribute this software and its | |
# documentation for any purpose and without fee is hereby granted, | |
# provided that the above copyright notice appear in all copies and that | |
# both that copyright notice and this permission notice appear in | |
# supporting documentation, and that the name of Vinay Sajip | |
# not be used in advertising or publicity pertaining to distribution |
NewerOlder