Skip to content

Instantly share code, notes, and snippets.

@shekhar-kamble
shekhar-kamble / MySQL_5.7_macOS-Big_Sur.md
Created January 31, 2022 06:02 — forked from wpconsulate/MySQL_5.7_macOS-Big_Sur.md
Install MySql 5.7 on MacOS Big Sur

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@shekhar-kamble
shekhar-kamble / example_query.sql
Created September 24, 2020 12:20
Its creates a group monthly time series of summation of "amount" from table "required_table" according to the "created_date" of the records
SELECT SUM(`required_table`.`amount`) AS sum_amount, DATE_ADD(CONVERT_TZ(DATE_FORMAT(CONVERT_TZ(DATE_SUB(created_date, INTERVAL 0 second), '+00:00', 'Etc/UTC'), '%Y-%m-01 00:00:00'), 'Etc/UTC', '+00:00'), INTERVAL 0 second) AS date_add_convert_tz_date_format_convert_tz_date_sub_created_date_interval_0_second_00_00_etc_utc_y_m_01_00_00_00_etc_utc_00_00_interval_0_second FROM `required_table` GROUP BY DATE_ADD(CONVERT_TZ(DATE_FORMAT(CONVERT_TZ(DATE_SUB(created_date, INTERVAL 0 second), '+00:00', 'Etc/UTC'), '%Y-%m-01 00:00:00'), 'Etc/UTC', '+00:00'), INTERVAL 0 second)

bank-app API

Parameters to Bank details

using IFSC code (GET)

https://bank-api-fyle.herokuapp.com/search/VALID_IFSC_CODE/

@shekhar-kamble
shekhar-kamble / main.go
Created April 5, 2019 19:18
example for usage of package "github.com/shekhar-kamble/ratelimit"
package main
import (
"github.com/shekhar-kamble/ratelimit"
"os"
"fmt"
)
func main(){
_ = os.Setenv("LIMITER_REDIS_URL","redis://127.0.0.1:6379")
rl,_ := ratelimit.New(2,10)
for i:=0; i<10;i++ {

Setting up

Add Environment Variables

Create a file called config.env that contains environment variables in the following syntax: ENVIRONMENT_VARIABLE=value.

  • ADMIN_EMAIL: set to the default email for your first admin account (default is admin@example.com)
  • ADMIN_PASSWORD: set to the default password for your first admin account (default is password)
  • DATABASE_URL: set to a sqlite database uri (default is data-dev.sqlite)
  • FLASK_CONFIG: development or production.

movie-app API

The movie-app API is a RESTful web service to obtain movie information.

Login into app

Using form submission

curl --request POST \
  --url http://test-app-movie.herokuapp.com/account/login \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data 'email=user@example.com&password=password'