Skip to content

Instantly share code, notes, and snippets.

View kumar303's full-sized avatar
💭
🍉

Kumar McMillan kumar303

💭
🍉
View GitHub Profile
11:47:1422992837 w.auth:INFO fetching FxA token from auth_response: "http://fireplace.loc/mozpay/spa/fxa-auth?state=d56038033e894fe289d6f75f9fc668be&code=4d9287d3798ed74a965505ee7d2d62c740bf4426ffbf862dcd03f20ffa4dbe6f" :/Users/kumar/dev/webpay/webpay/auth/views.py:175
11:47:1422992837 requests_oauthlib.oauth2_session:DEBUG Requesting url https://oauth-latest.dev.lcip.org/v1/token using method POST. :/Users/kumar/.virtualenvs/webpay/lib/python2.7/site-packages/requests_oauthlib/oauth2_session.py:273
11:47:1422992837 requests_oauthlib.oauth2_session:DEBUG Supplying headers {u'Accept': u'application/json'} and data {u'code': u'4d9287d3798ed74a965505ee7d2d62c740bf4426ffbf862dcd03f20ffa4dbe6f', u'client_secret': u'8eb806fd56338aa604117a3ee8ebe3337c8f2cf69511df52214f08383f70cc5c', u'grant_type': u'authorization_code', u'client_id': u'1947ea4dfba1911d'} :/Users/kumar/.virtualenvs/webpay/lib/python2.7/site-packages/requests_oauthlib/oauth2_session.py:274
11:47:1422992837 requests_oauthlib.oauth2_session:DEBUG Passin
@kumar303
kumar303 / new-fxpay-interface.js
Last active August 29, 2015 14:15
new fxpay interface with promises
// Fetch products from the API and also restore products from receipts.
// This used to be fxpay.init() and fxpay.getProducts()
// Old code:
// https://github.com/mozilla/fxpay/blob/master/example/shared/js/index.js#L41-L50
// https://github.com/mozilla/fxpay/blob/master/example/shared/js/index.js#L249-L257
fxpay.getProducts().then(function(allProducts) {
allProducts.forEach(function(product) {
console.log('product ID:', product.id);
console.log('product name:', product.name);
ALTER TABLE `users`
ADD COLUMN `last_login_attempt` DATETIME NULL DEFAULT NULL,
ADD COLUMN `last_login_attempt_ip` CHAR(45) NOT NULL DEFAULT '' AFTER `last_login_attempt`,
ADD COLUMN `failed_login_attempts` MEDIUMINT(8) UNSIGNED NOT NULL
DEFAULT '0' AFTER `last_login_attempt_ip`;
ALTER TABLE `users` CHANGE `fxa_uid` `username` varchar(255);
import unittest
from mohawk import Receiver, Sender
class TestBewit(unittest.TestCase):
def setUp(self):
self.credentials = {'id': 'some-sender',
'key': 'some complicated SEKRET',
@kumar303
kumar303 / gist:6369cd876edabf9b27f4
Last active August 29, 2015 14:21
GPG key proof

Keybase proof

I hereby claim:

  • I am kumar303 on github.
  • I am kumar (https://keybase.io/kumar) on keybase.
  • I have a public key whose fingerprint is ED25 3AD5 F740 4F8B 5BAB BE20 E8EF E298 1481 41C3

To claim this, I am signing this object:

@kumar303
kumar303 / patch.diff
Created September 3, 2015 17:43
payments-ui tests without Provider
diff --git a/tests/apps/test.management-app.jsx b/tests/apps/test.management-app.jsx
index 23836ec..dcdf9ba 100644
--- a/tests/apps/test.management-app.jsx
+++ b/tests/apps/test.management-app.jsx
@@ -2,7 +2,6 @@ import React from 'react';
import TestUtils from 'react/lib/ReactTestUtils';
import * as appActions from 'actions/app';
-import { createReduxStore } from 'data-store';
@kumar303
kumar303 / git-check.sh
Created June 16, 2011 21:08
Checks all changed and new files for pyflakes and pep8 errors (requires check.py)
# Runs new and changed Python files through check.py and other checks
# https://github.com/jbalogh/check
if [ "$1" = "--help" ]; then
echo "usage: `basename $0` [<commit>{0,2}]"
exit 1
fi
if [ "$1" != "" ]; then
REV=$1
fi
git diff $REV --check
diff --git a/scripts/update/update.py b/scripts/update/update.py
index 5cffb9b..9b98318 100644
--- a/scripts/update/update.py
+++ b/scripts/update/update.py
@@ -43,6 +43,7 @@ def update_code(ctx, ref='origin/master'):
ctx.local("git fetch && git fetch -t")
ctx.local("git checkout -f %s" % ref)
ctx.local("git submodule sync")
+ ctx.local("git submodule update --init --recursive")
# `submodule sync` doesn't do `--recursive` yet. (P.S. We `sync` twice
@kumar303
kumar303 / chirp-contrib-email.txt
Created November 5, 2012 16:55
Boilerplate email for first time CHIRP contributors
Hi there.
Thanks for your interest in CHIRP Radio's tech projects. The first thing is to jump on our low traffic discussion list where we announce projects and meetups: https://groups.google.com/group/chirpdev/
Let us know what type of things you are most interested in. Here is an overview of the project: http://code.google.com/p/chirpradio/ Here is a brief of summary of places you can help:
- MP3 importer and digital library manager (Python): https://github.com/chirpradio/chirpradio-machine
- A web based MP3 importer (Python/HTML5): https://github.com/chirpradio/chirpradio-webcontrol
- DJ tools (Python/HTML5): https://github.com/chirpradio/chirpradio
- Volunteer tracker (Python/HTML5): https://github.com/chirpradio/chirpradio-volunteers
- Android app (Java): https://github.com/chirpradio/chirpradio-android/

We're about to release some tools for developers to sign add-ons so they can publish the .xpi files to their own site as opposed to hosting them on addons.mozilla.org. This would let users install the add-ons in a release or beta channel when add-on signatures are required.

Can you help test what we have so far? Here's how:

  • Clone jpm and install it so you can run jpm from your shell:
git clone https://github.com/mozilla-jetpack/jpm.git
cd jpm
npm install