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
beforeEach(function () { | |
tester = new vumigo.test_utils.ImTester(app.api, { | |
custom_setup: function (api) { | |
api.config_store.config = JSON.stringify({ | |
user_store: "oneorg_ussd_dev", | |
metric_store: "oneorg_ussd_dev", | |
default_lang: "en_za" | |
}); | |
fixtures.forEach(function (f) { |
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
#PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' | |
function collapse_pwd { | |
echo $(pwd | sed -e "s,^$HOME,~,") | |
} | |
function prompt_char { | |
git branch >/dev/null 2>/dev/null && echo '±' && return | |
hg root >/dev/null 2>/dev/null && echo '☿' && return | |
echo '○' |
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
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="imsickofmaps" | |
# Example aliases |
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
function SilentEndState(name, text, next, handlers) { | |
// State that mimicks the USSD behaviour when a USSD session ends | |
// it fast forwards to the start of the InteractionMachine. | |
// We need to do this because SMS/Twitter doesn't have the Session capabities | |
// that provide us this functionality when using USSD. | |
var self = this; | |
handlers = handlers || {}; | |
if(handlers.on_enter === undefined) { | |
handlers.on_enter = function() { | |
self.input_event('', function() {}); |
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
self.get_contact = function(im){ | |
var p = im.api_request('contacts.get_or_create', { | |
delivery_class: 'twitter', | |
addr: im.user_addr | |
}); | |
return p; | |
}; |
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
def test_filter_pipeline_chaining(self): | |
fp = FilterPipeline([ | |
DirectionalFilter('inbound').chain( | |
MSISDNFilter('from_addr', '+27817030792')), | |
TimestampFilter('2013-09-10 00:00:00', '2013-09-10 23:59:59') | |
]) | |
stdin = StringIO(self.SAMPLE) | |
stdout = StringIO() | |
fp.process(stdin=stdin, stdout=stdout) | |
self.assertEqual(stdout.getvalue(), self.HEADER + self.INBOUND) |
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
less gdt/tests/messages-export-good.csv | python -m gdt.vumigomessage -m +27817030792 -d outbound -s "2013-09-09 19:37" -e "2013-09-09 19:41" |
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
(ve) ± jspot extract doagricussd.js -k _ | |
Error: on line 259 of file 'doagricussd.js' im is not defined | |
at run (/usr/local/lib/node_modules/jspot/lib/extract.js:88:15) | |
at /usr/local/lib/node_modules/jspot/lib/extract.js:12:16 | |
at Array.map (native) | |
at extract (/usr/local/lib/node_modules/jspot/lib/extract.js:11:30) | |
at /usr/local/lib/node_modules/jspot/lib/cli.js:80:32 | |
at Array.reduce (native) | |
at Object.commands.extract (/usr/local/lib/node_modules/jspot/lib/cli.js:77:32) |
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
diff --git a/go-js/lib/doagricussd.js b/go-js/lib/doagricussd.js | |
index 3d7fcce..a6d4bdd 100644 | |
--- a/go-js/lib/doagricussd.js | |
+++ b/go-js/lib/doagricussd.js | |
@@ -258,8 +258,8 @@ function DoAgricUSSD() { | |
p.add_callback(function (result) { | |
return self.send_sms(im, _.gettext( | |
"Thank you for adding your voice and supporting smallholder " + | |
- "farmers across Africa. Download our free ringtone here: " + | |
- im.config.download_ringback)); |
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
function validateSAID(idnum) { | |
idnum = idnum.toString().replace(" ", ""); | |
r = /^\d{10}[0-1]\d{2}$/; | |
if (!r.test(idnum)) return false; | |
n = idnum; | |
p1 = parseInt(n[0]) + parseInt(n[2]) + parseInt(n[4]) + parseInt(n[6]) + parseInt(n[8]) + parseInt(n[10]); | |
p2 = (parseInt(n[1] + n[3] + n[5] + n[7] + n[9] + n[11]) * 2).toString(); | |
p3 = 0; | |
for (i = 0; i < p2.length; i++) { | |
p3 += parseInt(p2[i]); |
OlderNewer