Skip to content

Instantly share code, notes, and snippets.

@khoazero123
khoazero123 / php-docker-ext
Created December 7, 2022 09:41 — forked from hoandang/php-docker-ext
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
@khoazero123
khoazero123 / guide.md
Created November 10, 2022 16:43 — forked from risan/guide.md
Windows 10, Laragon, PHP 5.6, SQL Server

Install SQL Server Express

  1. Download SQL Server Express 2019: https://www.microsoft.com/en-us/sql-server/sql-server-downloads
  2. Choose CUSTOM install
  3. Choose media download target location, leave it default.
  4. On SQL Server Installation Center choose "New SQL Server stand-alone installation..." menu.
  5. On Feature Selection at least select the main "Database Engine Services" option (SQL Server Replication, Machine Learning stuff, Full-Text search are optional). Also make sure all "Client Tools..." options and "SQL Client Connectivity SDK" are selected.
  6. On Instance Configuration we set the SQL Server instance name, we can leave all options default (SQLEXPRESS).
  7. On Server Configuration, we can set the "Startup Type" for "SQL Server Database Engine" to manual. So in order to use the SQL Server, we have to start it manualy through the Sql Server Configuration Manager application.
  8. On Database Engine Configuration set the "Authentication Mode" to Mixed Mode.
@khoazero123
khoazero123 / iterm2-solarized.md
Created October 16, 2020 02:25 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@khoazero123
khoazero123 / isLeapYear.js
Created August 13, 2020 01:49
Your task is to write a function that determines whether a year entered in traditional Japanese format is a leap year or not.
function isLeapYear(year) {
let yearInEra;
let [_, firstLetter, numOfYear] = /(\w)(\d+)/.exec(year);
numOfYear = parseInt(numOfYear) - 1;
switch (firstLetter) {
case 'M':
yearInEra = 1868 + numOfYear;
break;
case 'T':
yearInEra = 1912 + numOfYear;
@khoazero123
khoazero123 / count_groups.js
Created August 13, 2020 01:47
You are developing a social network. 2 people are considered to be friends if they know each other or have a friend in common. If 2 people are friends they will be in the same group of friends.
function count_groups(friend_pairs) {
let [numFriendPair, numElementsOfElment, ...numOfArray] = friend_pairs.split("\n");
let formatedArr = [];
for (let i = 0; i < numOfArray.length; i++) {
const [idA, idB] = numOfArray[i].trim().split(' ');
formatedArr.push([idA, idB]);
}
let newArr = [[...formatedArr[0]]];
for (let i = 1; i < formatedArr.length; i++) {
const [idA, idB] = formatedArr[i];
@khoazero123
khoazero123 / read_arguments.js
Created April 24, 2020 03:27 — forked from ishu3101/read_arguments.js
Accept input via stdin and arguments in a command line application in node.js
#!/usr/bin/env node
var args = process.argv.slice(2);
var input = args[0];
var isTTY = process.stdin.isTTY;
var stdin = process.stdin;
var stdout = process.stdout;
// If no STDIN and no arguments, display usage message
@khoazero123
khoazero123 / encryption.js
Created April 21, 2020 04:37 — forked from vlucas/encryption.ts
Stronger Encryption and Decryption in Node.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv);
@khoazero123
khoazero123 / setup_mailcatcher.sh
Created January 16, 2020 06:10 — forked from shark0der/setup_mailcatcher.sh
Mailcatcher installation script for Ubuntu 16.04 (14.04 commands commented out)
#!/bin/bash
# Install dependencies
# older ubuntus
#apt-get install build-essential libsqlite3-dev ruby1.9.1-dev
# xenial
apt install build-essential libsqlite3-dev ruby-dev
# Install the gem
gem install mailcatcher --no-ri --no-rdoc
@khoazero123
khoazero123 / Bookmarklet.txt
Created January 9, 2020 05:13 — forked from J2TEAM/Bookmarklet.txt
Bookmarklet to create links for your post on Facebook group. Create a new bookmark and paste this code.
data:text/html,<p style="text-align:center"><a href="https://www.junookyo.com" contenteditable>EDIT_ME</a></p>
@khoazero123
khoazero123 / gist:7f00f8cc6ae7cfe9c801170833457461
Created January 7, 2020 02:26
Visual Studio 2019 Product Key
Visual Studio 2019 Enterprise
BF8Y8-GN2QH-T84XB-QVY3B-RC4DF
Visual Studio 2019 Professional
NYWVH-HT4XC-R2WYW-9Y3CM-X4V3Y