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();
@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 / wkhtmltopdf_wkhtmltoimage.md
Last active October 19, 2017 14:56 — forked from isogram/wkhtmltopdf_wkhtmltoimage.md
How to manually install Wktohtmlpdf and Wkhtmltoimage in Ubuntu Server

Install Wkhtmltopdf and Wkhtmltoimage in Ubuntu

sudo apt-get install xz-utils
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz -P ~/
tar -xvf ~/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz -C ~/
cd ~/wkhtmltox/bin/
sudo mv wkhtmltopdf  /usr/bin/wkhtmltopdf
sudo mv wkhtmltoimage  /usr/bin/wkhtmltoimage
@rahman541
rahman541 / jqready.sublime-snippet
Created September 22, 2016 05:28
Sublime Text 2 snippet for $(document).ready()
<snippet>
<content><![CDATA[
<script type="text/javascript">
jQuery(document).ready(function(\$) {
${1://put all your jQuery goodness in here.}
});
</script>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>jqready</tabTrigger>