Skip to content

Instantly share code, notes, and snippets.

View sadiqmmm's full-sized avatar

Mohammed Sadiq sadiqmmm

View GitHub Profile
@sadiqmmm
sadiqmmm / phx-1.4-upgrade.md
Created November 9, 2018 17:40 — forked from chrismccord/phx-1.4-upgrade.md
Phoenix 1.3.x to 1.4.0 Upgrade Guides

Phoenix 1.4 ships with exciting new features, most notably with HTTP2 support, improved development experience with faster compile times, new error pages, and local SSL certificate generation. Additionally, our channel layer internals receiveced an overhaul, provided better structure and extensibility. We also shipped a new and improved Presence javascript API, as well as Elixir formatter integration for our routing and test DSLs.

This release requires few user-facing changes and should be a fast upgrade for those on Phoenix 1.3.x.

Install the new phx.new project generator

The mix phx.new archive can now be installed via hex, for a simpler, versioned installation experience.

To grab the new archive, simply run:

@sadiqmmm
sadiqmmm / subtitle_extractor.rb
Created January 17, 2019 17:37 — forked from aonemd/subtitle_extractor.rb
A Ruby script to extract text from images with subtitles and rename the image file to the extracted text (requires Tesseract to be installed)
require 'pathname'
require 'open3'
require 'mini_magick'
SRC_DIR = '/path/to/src/dir/'.freeze
TMP_DIR = '/path/to/tmp/dir/'.freeze
class TextReader
def initialize(input_path, output_path)
@input_path = input_path
@sadiqmmm
sadiqmmm / Wysiwyg.vue
Created January 28, 2019 05:50 — forked from izzygld/Wysiwyg.vue
Adding a “show html” button in Quill (Wysiwyg).
<template>
<div>
<vue-editor v-model="content" ref="editor" :editor-options="toolbarOptions" @text-change="updateValue" useCustomImageHandler @imageAdded="uploadImage"></vue-editor>
</div>
</template>
<script>
import Vue from "vue";
import axios from 'axios'
let VueEditor, Quill;
@sadiqmmm
sadiqmmm / letsencrypt_2018.md
Created March 2, 2019 13:26 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@sadiqmmm
sadiqmmm / webpacker_rails.md
Created March 6, 2020 16:53 — forked from maxivak/webpacker_rails.md
Webpack, Yarn, Npm in Rails
@sadiqmmm
sadiqmmm / postgres-cheatsheet.md
Created April 2, 2020 01:03 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@sadiqmmm
sadiqmmm / Gemfile
Created June 25, 2020 02:35 — forked from dhh/Gemfile
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
puts "Start: This is amazing"
puts "testing-embed-with-js.rb"
puts "End: This is amazing"
@sadiqmmm
sadiqmmm / Gemfile
Created October 10, 2020 12:13 — forked from petems/Gemfile
An example http download with Progress Bar output in the command line with Ruby and the native `net/http` library...
source "https://rubygems.org"
gem "progressbar"