Skip to content

Instantly share code, notes, and snippets.

View sagaragarwal94's full-sized avatar
🏠
Working from home

Sagar Chand Agarwal sagaragarwal94

🏠
Working from home
View GitHub Profile
@sagaragarwal94
sagaragarwal94 / foo.log
Created August 31, 2017 11:43 — forked from ibeex/foo.log
Flask logging example
A warning occurred (42 apples)
An error occurred
@sagaragarwal94
sagaragarwal94 / flask-app-test-demo.py
Last active August 18, 2017 10:07 — forked from ajdavis/flask-app-test-demo.py
Demonstrate "black pipe" testing a MongoDB application using MockupDB: http://mockupdb.readthedocs.org/
import unittest
from flask import Flask, make_response
from pymongo import MongoClient
from pymongo.errors import ConnectionFailure
from mockupdb import go, MockupDB, OpQuery
def make_app(mongodb_uri):
app = Flask("my app")
from . import sqlinjection
from flask import Flask, request, json, Response, jsonify, render_template, url_for, redirect
import mysql.connector
@sqlinjection.route('/SQLInjection', methods = ['GET','POST'])
def SQLinjection():
if request.method == 'POST':
idMovie = str(request.form['idMovie'])
try:
cnx = mysql.connector.connect(user='root', database='MovieTheatre', password="codecode")
@sagaragarwal94
sagaragarwal94 / osx-homebrew-setup.md
Created June 20, 2016 18:28 — forked from sr75/osx-homebrew-setup.md
Mac Yosemite OSX - Homebrew (RVM/MySQL/Redis) setup

Mac Homebrew (RVM/MySQL/Redis) setup

Follow the steps below to setup a local development environment:

XQuartz

Recommended to download latest XQuartz

iTerm2

@sagaragarwal94
sagaragarwal94 / rm_mysql.md
Created June 20, 2016 17:58 — forked from vitorbritto/rm_mysql.md
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

brew remove mysql

@sagaragarwal94
sagaragarwal94 / gist:724afe039d738e6d4c170ea6682ae144
Created May 4, 2016 06:54 — forked from learncodeacademy/gist:5f84705f2229f14d758d
Getting Started with Vagrant, SSH & Linux Server Administration