This file contains hidden or 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, request, make_response, jsonify | |
from flask_restful import Resource, Api | |
from json import dumps | |
from authy.api import AuthyApiClient | |
from dotenv import load_dotenv | |
import os | |
from validators.helpers import valid_user, valid_token, requires_token | |
from twilio.rest import Client |
This file contains hidden or 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
# Facebook Graph API Example in Python | |
# by James Thornton, http://jamesthornton.com | |
# Facebook API Docs | |
# https://developers.facebook.com/docs/graph-api/using-graph-api#reading | |
# Get Your Facebook Access Token Here... | |
# https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=me | |
# Before running this script... |
This file contains hidden or 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
class Stack { | |
constructor() { | |
this.stack = []; | |
} | |
push(element) { | |
this.stack.push(element); | |
} | |
pop() { |
This file contains hidden or 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 to simuate tower of hanoi */ | |
var hanoi = function(disc,src,aux,dst) { | |
if (disc > 0) { | |
hanoi(disc - 1,src,dst,aux); | |
$('#lists').append("Move disc " + disc + " from " + src + " to " + dst + "<br />"); | |
hanoi(disc - 1,aux,src,dst); | |
} | |
}; |
This file contains hidden or 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 fibonacci(num) { | |
if (num <= 1) return 1; | |
return fibonacci(num - 1) + fibonacci(num - 2); | |
} |
This file contains hidden or 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 factorial( n ) { | |
//terminate if x is less than one | |
if (n < 0) return; | |
//return base value for 1 | |
if ( n === 1 ) { | |
return 1; | |
} | |
//recur for values greater than one | |
return n * factorial( n - 1 ); | |
} |