Skip to content

Instantly share code, notes, and snippets.


Ali Raza a1iraxa

View GitHub Profile
a1iraxa /
Created October 15, 2021 15:27 — forked from joeytwiddle/
Do not use forEach with async-await

Do not use forEach with async-await

TLDR: Use for...of instead of forEach in asynchronous code.

The problem

Array.prototype.forEach is not designed for asynchronous code. (It was not suitable for promises, and it is not suitable for async-await.)

For example, the following forEach loop might not do what it appears to do:

View gist:008ffbb804a7319d875f93833e7148ce
You could just make your own pg_dump directly from your Heroku database.
First, get your postgres string using `heroku config:get DATABASE_URL`.
Look for the Heroku Postgres url (example: `HEROKU_POSTGRESQL_RED_URL: postgres://`), which format is `postgres://<username>:<password>@<host_name>:<port>/<dbname>`.
Next, run this on your command line:
pg_dump --host=<host_name> --port=<port> --username=<username> --password --dbname=<dbname> > output.sql
a1iraxa /
Created June 28, 2021 16:45 — forked from croxton/
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

DNS.1   =

Additional FQDNs can be added if required:

a1iraxa / copy.js
Created April 15, 2021 23:08 — forked from GarySwift/copy.js
5 ways copy text to clipboard using jQuery (+ JavaScript)
View copy.js
jQuery(document).ready(function($) {
// If a copy clickable input is clicked
// input value will be highlighted and copied to clipboard
$('body').on('click', 'input.js-click-to-copy-input', function(e) {
copy_input( this );
// If a button to copy an input is clicked
// associated input value will be highlighted and copied to clipboard
$('body').on('click', 'a.js-click-to-copy-link', function(e) {
a1iraxa /
Created July 24, 2020 16:50 — forked from msurguy/
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at

View mysql

MySQL Cheatsheet

This is a collection of the most common commands I run while administering Mysql databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Mysql has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.


installation, Ubuntu 14.04

sudo apt-get update

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

a1iraxa / app-1.js
Created March 31, 2020 17:06 — forked from igorbenic/app-1.js
Using React to Render Content from WP REST API |
View app-1.js
class App extends React.Component {
render() {
return (
const element = <App />
a1iraxa / Component.jsx
Created March 29, 2020 16:57 — forked from krambertech/Component.jsx
ReactJS: Input fire onChange when user stopped typing (or pressed Enter key)
View Component.jsx
import React, { Component } from 'react';
import TextField from 'components/base/TextField';
const WAIT_INTERVAL = 1000;
const ENTER_KEY = 13;
export default class TextSearch extends Component {
constructor(props) {