Skip to content

Instantly share code, notes, and snippets.

View profnandaa's full-sized avatar
🙃
/dev

Anthony Nandaa profnandaa

🙃
/dev
View GitHub Profile
application: filehangar
version: live
runtime: python
api_version: 1
handlers:
- url: /remote_api
script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py
login: admin
@profnandaa
profnandaa / gist:4964904
Last active December 13, 2015 19:48
Kenya Presidential Candidates 2013 URLs
[
{
'name':'Martha Karua',
'twitter':'MarthaKarua',
'website': 'http://www.joinmarthakarua.com',
'mzalendo': 'http://info.mzalendo.com/person/martha-karua/',
'mavulture': ''
},
{
'name':'Musalia Mudavadi',
@profnandaa
profnandaa / git-snippets
Created June 30, 2014 06:30
Git snippets and fixes.
git reset --hard # removes staged and working directory changes
git clean -f -d # remove untracked files
git clean -f -x -d # CAUTION: as above but removes ignored files like config.
@profnandaa
profnandaa / algos-prep
Created October 14, 2014 08:33
Excercises for improving your algorithms skills.
https://code.google.com/p/prep/wiki/ExercisesList
<?php
// Our previous code, getting details from MPesa IPN
// send SMS (AfricasTalking API)
$recipients = "+" . $_REQUEST["mpesa_msisdn"];
$message = "Dear " . $_REQUEST["mpesa_sender"] . ", we acknowledge receipt of Ksh. " . $_REQUEST["mpesa_amt"] . " for " . $_REQUEST["mpesa_acc"] . ". Thanks for your support and God bless. FOCUS - Reaching Students Changing Nations.";
include_once("sms/send_sms.php");
const Developer = require('developer');
let months = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ');
let year = (new Date()).getFullYear();
let you = new Developer();
while (year >= 2016) {
months.forEach((m, i) => {
you.attendMonthlyForLoopEvent(m);
you.shareExperience();
@profnandaa
profnandaa / 0-Messenger-Bot.md
Last active April 19, 2018 20:51
Introduction to Facebook Messenger Bots - @DevC-Nairobi

Building a Basic Messenger Bot with Node.js

For this tutorial, you need just basic understanding of JavaScript. The aim of this tutorial is to show you how easy it is to build messenger bots. When you scroll down this page, you will find out the actual lines of code that we will write are just about 19 LOC.

Prerequisites

Keybase proof

I hereby claim:

  • I am profnandaa on github.
  • I am profnandaa (https://keybase.io/profnandaa) on keybase.
  • I have a public key whose fingerprint is 0C35 8782 6463 D654 B4F5 66B1 AB30 3CCA 6093 30BD

To claim this, I am signing this object:

@profnandaa
profnandaa / script-on-reboot.md
Last active August 15, 2017 18:03
Server Recipes

One approach is to add an @reboot cron [1] task:

  1. Running crontab -e will allow you to edit your cron.

  2. Adding a line like this to it:

     @reboot /path/to/script
    

    will execute that script once your computer boots up.

[Initial draft, adapted from Mike Bowler, @mike_bowler and Dave Nicolette, @DaveNicolette]

Pair Programming Styles

Driver-Navigator The driver is at the keyboard, and takes a tactical view of the problem. The navigator observes and takes a strategic view of the problem, offering suggestions and asking questions. The roles may switch back and forth as needed, depending on how the work flows and how the interaction between the two people works

Useful for general development and for knowledge/skill transfer. When used for knowledge/skills transfer, the junior member takes the driver role and the senior member takes the navigator role

Ping-Pong