Skip to content

Instantly share code, notes, and snippets.

View javagrails's full-sized avatar
💗
Coding - Coding - Coding & Coding

Salman* javagrails

💗
Coding - Coding - Coding & Coding
View GitHub Profile
@javagrails
javagrails / Yii One Line Command For Windows
Last active December 15, 2015 11:10
Yii project creationn One Line Command
Yii One Line Command for Windows
1. Press [ Windows+r ] command
2. Paste/type the line [ d:\xampp\htdocs\framework\yiic webapp d:\xampp\htdocs\project_name ]
3. Press Enter....
4. CMD promt will open and ask you for Yes/No
5. Type [ Yes ] press enter...
6. Finish project created in your htdocs with name [ project_name ]
____Thank You
@javagrails
javagrails / EnDecryption.php
Last active December 17, 2015 20:38
Simple Class for PHP Encryption Decryption
<?php
class EnDecryption
{
public static $saltKey = ''; //You Can Change This as Your Own By Calling Constructor
function __construct($salt = 'setDefaultSalt')
{
//print 'Default Salt : ' . $salt;
EnDecryption::$saltKey = $salt;
//print '<br/>EnDecryption::saltKey : ' . EnDecryption::$saltKey . '<br/>';
@javagrails
javagrails / JavaCalendarAddSubtractDateMonths.java
Last active December 27, 2015 08:59
Operation on java.util.Calendar Class
import java.util.Calendar;
public class JavaCalendarAddSubtractDateMonths {
public static void main(String[] args) {
int monthsToAdd = 2;
int monthsToSubtract = 10;
Calendar c = Calendar.getInstance(); // this takes current date
@javagrails
javagrails / GroovyStringOperationExample.groovy
Last active December 22, 2015 03:52
Groovy String Operation Examples
//How to get last 2/5 digit/char from a String
static main(args) {
String texter = "5793231309"
String texter2 = texter[-2..-1]
String texter5 = texter[-5..-1]
println(texter2) // 09
println(texter5) // 31309
}
@javagrails
javagrails / JavaIntegerBehave.java
Last active December 22, 2015 03:39
Java Integer Behaviour magic or bug? (not it's not bug) or you can give a name .... But it's a fine manage of JAVA architACT
public class JavaIntegerBehave {
public static void main(String[] args) {
Integer i= new Integer(10);
Integer j= new Integer(10);
System.out.println("R1: "+(i==j)); // false
Integer k= 10;//new Integer(10);
Integer l = 10;//new Integer(10);
@javagrails
javagrails / index.html
Last active July 9, 2021 12:17
How to Setup a Local Static File Server in Windows by XAMPP - M.M. Saleh (Salman)
How to Setup a Local Static File Server in Windows by XAMPP
M.M. Saleh (Salman) - https://github.com/javagrails
total.bk - it may be a file server
1. create a folder for server root path in location [ D:\zfileserver ]
2. Go to the path [D:\xampp\apache\conf\extra]
Open the file [ httpd-vhosts.conf ]
@javagrails
javagrails / DateStringFormatter.java
Last active June 16, 2016 08:50
Java Custom Date Formatter
import java.util.Date;
import java.text.ParseException;
import java.text.SimpleDateFormat;
/**
* <b>DateStringFormatter</b>
*
* @author Salman
* Url https://github.com/javagrails
* @ since Created by Salman on 3/22/2016.
@javagrails
javagrails / yarn-jhipster-update-commands.txt
Created December 14, 2017 18:56
yarn jhipster update commands
whereis yarn
yarn -v
sudo apt-get remove yarn && sudo apt-get purge yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn -y
@javagrails
javagrails / docker-helps.md
Last active December 28, 2017 19:14
docker common commands

Docker Helps

Docker is a tool which helps developers build and ship high quality applications, faster, anywhere.

Why Docker

With Docker, developers can build any app in any language using any toolchain. Dockerized apps are completely portable and can run anywhere.

Developers can get going by just spinning any container out of list on Docker Hub. Docker manages and tracks changes and dependencies, making it easier for sysadmins to understand how the apps that developers build work. And with Docker Hub, developers can automate their build pipeline and share artifacts with collaborators through public or private repositories.

@javagrails
javagrails / ubuntu-dev-env-ready-commands.txt
Last active November 1, 2019 09:12
ubuntu develop environment ready commands
===== ## ubuntu OS Information =====
sudo lsb_release -a
===== ## build essential for ubuntu =====
sudo apt-get install -y build-essential
sudo apt-get install libpng-dev libjpeg-dev -y
sudo apt-get install pngquant -y
sudo apt-get install unrar -y