Skip to content

Instantly share code, notes, and snippets.

View imsickofmaps's full-sized avatar

Mike Jones imsickofmaps

View GitHub Profile
jspot extract go-app-personal.js -k $
mv messages.pot config/go-app-personal.pot
jspot extract go-app-optout.js -k $
mv messages.pot config/go-app-optout.pot
jspot extract go-app-chw.js -k $
mv messages.pot config/go-app-chw.pot
jspot extract go-app-clinic.js -k $
mv messages.pot config/go-app-clinic.pot
jspot extract go-app-servicerating.js -k $
messages.pot config/go-app-servicerating.pot
// Show questions in topic x
self.states.add('states_questions', function(name, opts) {
return go.utils.get_snappy_questions(self.im,
self.im.config.snappy.default_faq, self.im.user.answers.states_start)
.then(function(response) {
if (typeof response.data.error !== 'undefined') {
// TODO Throw proper error
return error;
} else {
var choices = response.data.map(function(d) {
@imsickofmaps
imsickofmaps / payfast_inbound.py
Created July 25, 2014 12:30
Some payfast Flask integration
from hashlib import md5
def validate_secure_form(form, provider):
""" Does an MD5 sum against the form items """
if provider == "payfast":
formsignature = form["signature"]
formdetails = [
tuple(["m_payment_id", form["m_payment_id"]]),
tuple(["pf_payment_id", form["pf_payment_id"]]),
tuple(["payment_status", form["payment_status"]]),
{
"meta": {
"limit": 20,
"next": null,
"offset": 0,
"previous": null,
"total_count": 10
},
"objects": [
{
{
"user_account": "f299ca6f-555b-4c21-acec-506c4100a8b3",
"conversation_key": "5dbad45a-26f0-4955-20ec-9dd80f5bd098",
"contact": {
"extra": {
"clinic_code": "123456",
"suspect_pregnancy": "yes",
"id_type": "none",
"ussd_sessions": "5",
"last_stage": "states_language",
self.send_sms_first_possible_timeout = function(im) {
var _ = im.i18n;
var msg = _.gettext("Your Lima Links USSD session timed out." +
" Dial *739*739# to resume.");
return self.send_sms(im, msg);
};

Any aspiring founder now has multiple ideas. They probably have a list of different startup ideas. How do you assess an idea?

Typically I've selected ideas because they were able to attract people that I really wanted to work with and spend some of my life with.

That’s interesting. So you don’t look at how much money you could potentially make from an idea?

Oh, no. Honestly that’s probably to my fault as an entrepreneur. It's a double-edged sword. But it's never really been my prioritizing feature.

Why?

return self.incr_kv([self.store_name, 'unique_users'].join('.'))
.then(function(result){
var clinic_users = result.value;
return self.get_kv([self.env, 'chw', 'unique_users'].join('.'))
.then(function(result){
var chw_users = result.value;
return self.get_kv([self.env, 'personal', 'unique_users'].join('.'))
.then(function(result){
var personal_users = result.value;
var total_users = clinic_users + chw_users + personal_users;
@imsickofmaps
imsickofmaps / body_snatchers.js
Last active August 29, 2015 14:01
Fixture fixing fixer change
var fs = require('fs');
self.matchers.body = function(request, fixture) {
fs.writeFileSync('http_dummy_body_output.txt', request.data);
fs.writeFileSync('http_fixture_body_output.txt', fixture.request.body);
return true;
// return request.data && fixture.request.data
// ? _.isEqual(request.data, fixture.request.data)
// : request.body === fixture.request.body;
};
self.check_valid_number = function(input){
// an attempt to solve the insanity of JavaScript numbers
var numbers_only = new RegExp('^\\d+$');
if (input !== '' && numbers_only.test(input) && !Number.isNaN(Number(input))){
return true;
} else {
return false;
}
};