Skip to content

Instantly share code, notes, and snippets.

View rahman541's full-sized avatar
🎯
Focusing

Rahman rahman541

🎯
Focusing
View GitHub Profile
@rahman541
rahman541 / yii2-drop-all-tables-from-database.php
Created August 11, 2018 20:04
*UPDATED*: How to drop all tables from database using Yii2. Includes disabling foreign key checks, fixed app() and execute().
<?php
Yii::$app->db->createCommand("SET foreign_key_checks = 0")->execute();
$tables = Yii::$app->db->schema->getTableNames();
foreach ($tables as $table) {
Yii::$app->db->createCommand()->dropTable($table)->execute();
}
Yii::$app->db->createCommand("SET foreign_key_checks = 1")->execute();
<!DOCTYPE html>
<html>
<head>
<title>Test with RxJS</title>
</head>
<body>
<input type="text" id="txtinput" placeholder="Search in wikipedia">
<button>Click me</button>
<select id="select"></select>
<!DOCTYPE html>
<html>
<head>
<title>Functional Programming</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<style type="text/css">
.form-control {
margin-top: .5rem;
}
</style>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div id="app">
{{ welcome }}
<h2>{{ message }}</h2>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div id="app">
{{ status }}
</div>
@rahman541
rahman541 / dynamic-form.html
Created July 31, 2018 06:45
Dynamic form using Vue Js & Bootstrap 4
<!DOCTYPE html>
<html>
<head>
<title>Dynamic Form With Vue Js</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
</head>
<body>
<div class="container">
<button class="btn btn-success mt-5 mb-5"
@click="addNewEmployeeForm">New Employee</button>
@rahman541
rahman541 / stop_service.bat
Created December 4, 2017 17:55
Elevated commmand prompt
::::::::::::::::::::::::::::::::::::::::::::
:: Automatically check & get admin rights V2
::::::::::::::::::::::::::::::::::::::::::::
@echo off
CLS
ECHO.
ECHO =============================
ECHO Running Admin shell
ECHO =============================
@rahman541
rahman541 / README.md
Last active August 31, 2021 04:34 — forked from ArrEssJay/env.conf
ngrok / ngrok2 systemd script + config
cd ~
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip -P ~
unzip ngrok-stable-linux-amd64.zip
sudo mv ngrok /usr/local/bin/
# To test out ngrok ssh background
ngrok tcp 22 --log=stdout > ~/ngrok.log &
# To copy token goto: https://dashboard.ngrok.com/get-started
ngrok authtoken ...
nano ~/.ngrok2/ngrok.yml
@rahman541
rahman541 / install.md
Created November 11, 2017 19:52
Install chrome in kali linux
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
apt-get install gdebi
gdebi google-chrome-stable_current_amd64.deb
@rahman541
rahman541 / demo_ansible.md
Last active November 4, 2017 15:13
Ansible: Automate IT Infrastructure configuration & deployment.

Intro

This will install & running nginx latest on Ubuntu with ip 192.168.48.133. Tested on Ubuntu 16.04 x64 LTS

Setup

Install Ansible

Install on OS running Ubuntu or in VM will work also.

sudo apt-get update
sudo apt-get install software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update