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
from flask import Flask | |
from flask_restful import reqparse, abort, Api, Resource | |
app = Flask(__name__) | |
api = Api(app) | |
TODOS = { | |
'todo1': {'description': 'Build a REST API'}, | |
'todo2': {'description': 'Connect to database'}, | |
'todo3': {'description': 'Host documentation on Heroku'}, |
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
// registerurl | |
/* | |
Request POST /mpesa/c2b/v1/registerurl HTTP/1.1 | |
*/ | |
{ | |
"ShortCode": "600482", | |
"ResponseType": "Completed the Mwavuli Transaction", | |
"ConfirmationURL": "https://urlhitter.herokuapp.com/api/v1/callbacks", | |
"ValidationURL": "https://urlhitter.herokuapp.com/api/v1/callbacks" |
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
Python 2.7.10 (default, Jul 15 2017, 17:16:57) | |
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> changing = 1 | |
>>> print(changing) | |
1 | |
>>> changing = 15 | |
>>> print(changing) | |
15 | |
>>> variable=3 |
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
// make new directory to create directory | |
$ mkdir new_directory | |
// change directory to create directory | |
$ cd new_directory | |
// create a new file | |
$ touch cmd.txt | |
// create child_directory |
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
<div class="app_con"> | |
<div class="app_base"> | |
<div class="app_top"> | |
<div class="top_con"> | |
<div class="top_base"> | |
<nav class="navbar navbar-white navbar-fixed-top" role="navigation"> | |
<div class="container"> | |
<div class="navbar-header"> | |
<button class="navbar-toggle collapsed" type="button"> | |
<!-- data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"--><span class="sr-only">Toggle |
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
<html ng-app="gemStore"> | |
<head> | |
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet"> | |
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"> | |
<link crossorigin="anonymous" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity= | |
"sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" rel="stylesheet"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.8/angular.js" type="text/javascript"> | |
</script> | |
<script crossorigin="anonymous" integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s=" src="https://code.jquery.com/jquery-3.1.0.min.js"> | |
</script> |
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
var fruits = ["Banana", "Orange", "Apple", "Mango"]; | |
fruits.push("Kiwi", "Lemon", "Pineapple"); | |
console.log(fruits); | |
fruits.unshift("Guava"); | |
console.log(fruits); | |
delete fruits[0]; | |
console.log(fruits); | |
fruits.splice(1,1); |
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
var contains = function(needle) { | |
// Per spec, the way to identify NaN is that it is not equal to itself | |
var findNaN = needle !== needle; | |
var indexOf; | |
if(!findNaN && typeof Array.prototype.indexOf === 'function') { | |
indexOf = Array.prototype.indexOf; | |
} else { | |
indexOf = function(needle) { | |
var i = -1, index = -1; |
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
var removeByAttr = function(arr, attr, value){ | |
var i = arr.length; | |
while(i--){ | |
if( arr[i] | |
&& arr[i].hasOwnProperty(attr) | |
&& (arguments.length > 2 && arr[i][attr] === value ) ){ | |
arr.splice(i,1); | |
} |
NewerOlder