Skip to content

Instantly share code, notes, and snippets.

View alyjee's full-sized avatar
💭
code

Tahir Raza alyjee

💭
code
View GitHub Profile
@alyjee
alyjee / make-diamond.php
Created June 25, 2018 10:45
How to display a complete diamond in PHP
<?php
$n = 9;
$index = 1;
$trend = 'upward';
for ($i=1; $i <= $n; $i++) {
$stars = $n - ($n - $index);
if($index >= $n){
$trend = 'downward';
}
@alyjee
alyjee / querires.sql
Last active June 26, 2018 13:27
Some usual/unusual queries for mySql
-- Load Data from a text file with comma separated columns
LOAD DATA LOCAL INFILE '/path/to/file.txt' INTO TABLE `tableName`
FIELDS TERMINATED BY 'x'
-- (here x could be comma ',', tab '\t', semicolon ';', space ' ')
LINES TERMINATED BY 'y';
-- (here y is a new line character, it can be ¬, \n or anything) sometimes you may need to use only fields teminated by
----------------------------------------------------------------
@alyjee
alyjee / ERPNext-issues
Last active July 11, 2019 12:29
Issue Tracks in ERPNext
Issue#1
Freshly installed ERPNext, run following command
- bench --site [site name] set-limit users 2000
It will give you an error, in user.py line 315
system_manager = get_system_managers(only_name=True)[-1]
This list will get out of index if there's no system manager added, as on fresh
installation there's only Administrator and Guest user.
@alyjee
alyjee / js-hikes.js
Created May 7, 2019 21:05
A gist which contains secrets of Javascaript, jQuery and the family.
$('.add-new-payment').on('click', function(){
var received_amount = $('.payment-detail-row:last').find('.received_amount_input').val();
var remaining_amount = $('.payment-detail-row:last').find('.remaining_amount_input').val();
var receiving_date = $('.payment-detail-row:last').find('.mydatepicker').val();
if(
received_amount == '' || received_amount == null ||
remaining_amount == '' || remaining_amount == null ||
receiving_date == '' || receiving_date == null
){
@alyjee
alyjee / gist:b650ebe8b6dc6d5598b0213ea7f4222e
Created August 4, 2020 11:55
Easy Install Script for Frappe ERPNext
# Pls follow below step to get install ERPNext Version 12.
# I have installed fresh ERPNext 12 on Ubuntu 18.0.4LTS on Windows Subsystem Linux
# Ran the below commands
sudo apt-get update && upgrade
# Rebooted server
sudo mkdir -p /run/dbus
sudo service dbus start
sudo apt-get install python3-setuptools python3-minimal redis-server build-essential