Skip to content

Instantly share code, notes, and snippets.

View fhsinchy's full-sized avatar
🎯
Trying to focus

Farhan Hasin Chowdhury fhsinchy

🎯
Trying to focus
View GitHub Profile
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}
@fhsinchy
fhsinchy / yt-down.sh
Created July 3, 2019 10:29
download numbered videos from playlist with youtube-dl
youtube-dl --external-downloader aria2c --output "<folder name>/%(playlist_index)s-%(title)s.%(ext)s" <playlist link>
@fhsinchy
fhsinchy / django-vagrantfile
Last active September 22, 2019 16:42
vagrantfile for django development
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@fhsinchy
fhsinchy / poetry-virtualenv
Last active March 16, 2020 16:15
Python-poetry virtualenv location
MacOS - ~/Library/Caches/pypoetry/virtualenvs
Linux - ~/.cache/pypoetry/virtualenvs
@fhsinchy
fhsinchy / MySQLClient-MacOS
Last active March 30, 2020 19:19
Installation process for MySQLClient python package on MacOS
brew install mysql@5.7 mysql-connector-c openssl
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
brew services start mysql@5.7
xcode-select --install
brew unlink mysql@5.7
brew link --overwrite --force mysql-connector-c
@fhsinchy
fhsinchy / Python3-w-tk
Created April 5, 2020 17:40
Installation process of python 3 with tcl-tk and pyenv
brew install pyenv
brew install tcl-tk
# add these to your rc file
# tcl-tk
export PATH="/usr/local/opt/tcl-tk/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/tcl-tk/lib"
export CPPFLAGS="-I/usr/local/opt/tcl-tk/include"
export PKG_CONFIG_PATH="/usr/local/opt/tcl-tk/lib/pkgconfig"
export PYTHON_CONFIGURE_OPTS="--with-tcltk-includes='-I/usr/local/opt/tcl-tk/include' --with-tcltk-libs='-L/usr/local/opt/tcl-tk/lib -ltcl8.6 -ltk8.6'"
import { Client } from "https://deno.land/x/mysql/mod.ts";
const client = await new Client().connect({
hostname: Deno.env.get("DB_HOST"),
username: Deno.env.get("DB_USER"),
password: Deno.env.get("DB_PASSWORD"),
db: Deno.env.get("DB_DATABASE"),
});
export default client;
import { Status } from "https://deno.land/x/oak@v6.5.0/mod.ts";
import client from "../db/mysql.ts";
export async function index(ctx: any) {
const blogs: any = (await client.execute("SELECT * FROM blogs")).rows;
ctx.response.status = Status.OK;
ctx.response.type = "json";
ctx.response.body = {
import { Router } from "https://deno.land/x/oak@v6.5.0/mod.ts";
import { index, } from "../controllers/blogs.ts";
const router = new Router();
router.get("/blogs", index);
export default router;