Skip to content

Instantly share code, notes, and snippets.

View a1iraxa's full-sized avatar

Ali Raza a1iraxa

View GitHub Profile
@a1iraxa
a1iraxa / publickey-git-error.markdown
Created July 6, 2023 05:46 — forked from adamjohnson/publickey-git-error.markdown
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "your_email@example.com". Th
@a1iraxa
a1iraxa / async-await-forEach-alternatives.md
Created October 15, 2021 15:27 — forked from joeytwiddle/async-await-forEach-alternatives.md
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:

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://user3123:passkja83kd8@ec2-117-21-174-214.compute-1.amazonaws.com:6212/db982398`), 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
a1iraxa / SSL-certs-OSX.md
Created June 28, 2021 16:45 — forked from croxton/SSL-certs-OSX.md
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   = my-project.dev

Additional FQDNs can be added if required:

@a1iraxa
a1iraxa / copy.js
Created April 15, 2021 23:08 — forked from GarySwift/copy.js
5 ways copy text to clipboard using jQuery (+ JavaScript)
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
a1iraxa / List.md
Created July 24, 2020 16:50 — forked from msurguy/List.md
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

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.

Setup

installation, Ubuntu 14.04

https://help.ubuntu.com/14.04/serverguide/mysql.html

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
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 | https://ibenic.com/react-render-content-wp-rest-api
class App extends React.Component {
render() {
return (
bla
)
}
}
const element = <App />