Skip to content

Instantly share code, notes, and snippets.

#! /usr/bin/env python
# -*- coding: utf-8 -*-
from app import (app, logging)
from flask import (render_template, make_response, request, jsonify)
from random import shuffle
from pyga.requests import Tracker, Page, Session, Visitor, Event
import redis
r = redis.StrictRedis(host='localhost', port=6379, db=0)
<?php
// Sending onDemand premium messages
require_once('AfricasTalkingGateway.php');
$username = "MyAfricasTalkingUsername";
$apikey = "MyAfricasTalkingAPIKey";
$recipient = "+254711XXXYYY";
exception: /build/grive2-njjCJE/grive2-0.5/libgrive/src/http/CurlAgent.cc(191): Throw in function long int gr::http::CurlAgent::ExecCurl(const string&, gr::DataStream*, const gr::http::Header&)
Dynamic exception type: boost::exception_detail::clone_impl<gr::http::Error>
[gr::expt::BacktraceTag*] = #0 0x506f9e grive gr::Exception::Exception()
#1 0x4e67d7 grive gr::http::Error::Error()
#2 0x4e5e51 grive gr::http::CurlAgent::ExecCurl(std::string const&, gr::DataStream*, gr::http::Header const&)
#3 0x4e60fe grive gr::http::CurlAgent::Request(std::string const&, std::string const&, gr::SeekStream*, gr::DataStream*, gr::http::Header const&)
#4 0x4ee180 grive gr::AuthAgent::Request(std::string const&, std::string const&, gr::SeekStream*, gr::DataStream*, gr::http::Header const&)
#5 0x4e167c grive gr::v2::Syncer2::Upload(gr::Resource*)
#6 0x4e00aa grive gr::v2::Syncer2::Create(gr::Resource*)
#7 0x4d1efe grive gr::Resource::SyncSelf(gr::Syncer*, gr::Val const&)
import sbt._
import Keys._
import sbtassembly.AssemblyKeys._
object Build extends Build {
val akkaVersion = "2.3.3"
val sprayVersion = "1.3.1"
connectInput in run := true
@ianjuma
ianjuma / AT.php
Created April 1, 2016 08:30
Code with sessions
<?php
//I have created table users with columns username varchar(30), phonenumber varchar(20), city varchar(30), status enum('ACTIVE', 'SUSPENDED')
//and table session_levels with columns session_id varchar(50), phoneNumber varchar(25), level tinyint(1)
/*This code just shows the registration part but not the booking*/
if(!empty($_POST)){
require_once('sankaraDB.php');
require_once('AfricasTalkingGateway.php');
require_once('config.php');
@ianjuma
ianjuma / config.php
Created April 1, 2016 08:29
Config file
<?php
// Specify your login credentials
$username = "the_USERNAME";
$apikey = "the_APIKEY";
?>
@ianjuma
ianjuma / connector.php
Created April 1, 2016 08:28
Connect to DB
<?php
//This allows you to connect to your DB
//connection credentials
$servername = getenv("IP");
$username = getenv("C9_USER");
$password = "";
$database = "lakehub";
$dbport = 3306;
//Connect to DB
worker_processes 4;
user www www ;
error_log /var/log/nginx/error.log;
pid /var/log/nginx/nginx.pid;
include /opt/nginx/sites-enabled/*;
worker_rlimit_nofile 8192;
events {
---
- hosts: autobay
vars_files:
- vars/main.yml
remote_user: root
tasks:
- name: Add Nginx repository
Hackathon Ideas:
http://hackathon-in-a-box.org/guide/
http://www.squirrly.co/a-beginners-guide-to-hackathon#.VNHwklSUc8o
http://www.socrata.com/open-data-field-guide/how-to-run-a-hackathon/
http://hackdaymanifesto.com/
https://hackathon.guide/