Skip to content

Instantly share code, notes, and snippets.

View MhdAljuboori's full-sized avatar

Mohammed Al-Juboori MhdAljuboori

View GitHub Profile
@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
const POSITION = (function() {
var inner = {};
Object.defineProperty(inner, 'left', {
writable: false,
value: 1
})
Object.defineProperty(inner, 'right', {
writable: false,
value: 2
@Tiriel
Tiriel / encryption.js
Last active June 21, 2024 07:53
Symetric encryption/decryption for PHP and NodeJS communication
'use strict';
const crypto = require('crypto');
const AES_METHOD = 'aes-256-cbc';
const IV_LENGTH = 16; // For AES, this is always 16, checked with php
const password = 'lbwyBzfgzUIvXZFShJuikaWvLJhIVq36'; // Must be 256 bytes (32 characters)
function encrypt(text, password) {
@ernsheong
ernsheong / access-mac-localhost-from-parallels-desktop-ie-edge.md
Last active June 14, 2024 08:39
Accessing macOS localhost from Parallels Desktop IE or Edge

Access macOS localhost from IE or Edge within Parallels Desktop

This issue is so infuriating that I'm going to take some time to write about it.

  1. MOST IMPORTANT. Your local development server must be bound to IP address 0.0.0.0. Some do this by default, but many don't. You need to make sure that you run your local server with correct IP bindings. You may need to provide additional flags to your serve commands e.g. polymer serve --hostname domain.local, hugo serve --bind 0.0.0.0. If you use a named domain like domain.local, it has to be defined in /etc/hosts and pointing at 0.0.0.0.

  2. My Parallels setting is using Shared Network, nothing special there.

  3. Open macOS Terminal and type ifconfig. Look for the value under vnic0 > inet. It is typically 10.211.55.2.

@amitbend
amitbend / nodemailer with Zoho
Last active October 17, 2022 12:32
nodemailer with Zoho
const nodemailer = require('nodemailer');
const transporter = nodemailer.createTransport({
host: 'smtp.zoho.com',
port: 465,
secure: true, //ssl
auth: {
user: 'youremail@amitbend.com',
pass: 'yourpassword'
}
});