Skip to content

Instantly share code, notes, and snippets.

View VishalTaj's full-sized avatar
🎯
Focusing

Vishal Taj PM VishalTaj

🎯
Focusing
  • Kuala Lampur, Malaysia
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<form action="" method="post" enctype="multipart/form-data">
<input type="file" name="file"><br />
<input type="submit" value="Submit">
<!DOCTYPE html>
<html>
<head>
<style>
input {
background-color: #ccc;
height: 50px;
font-style: bold;
}
.number {
#! /usr/bin/env python
__author__ = 'Vishal Taj PM'
import subprocess
import os
import shutil
def create_virtualenv(envName):
subprocess.call(['virtualenv', envName])
@VishalTaj
VishalTaj / getDicKeyValues.py
Last active December 10, 2015 13:14
Fetching value from a nested dictionary
#!/usr/bin/python
__author__ = 'Vishal Taj PM'
def getDicKeyValue(data,search):
'''
This can also be used to get data from json object
Instruction
Function accepts 2 parameter
1 A nested dictionary
2 List of Keys in order to travers
'''
#!/bin/bash
# Author : Vishal Taj PM
# This is simple script which lets you ease of remembering server url just need to remember shortkeys instead of it
# Copy this script to bin folder
# run: filename t -> this will log into the testing environment
case $1 in
"t")
label='My test url'
<?php
ini_set('display_errors', '0');
require_once "Mail.php";
require_once "Mail/mime.php";
require_once 'config.inc.php'; # you can define constants in this file.
class Mailer {
var $_headers = array();
@VishalTaj
VishalTaj / crud_concern_rails.rb
Last active June 1, 2022 15:08
CRUD Concern for Rails Controllers
module CrudConcern
extend ActiveSupport::Concern
# Rails version < 5
##################################################################
# This module take cares the CRUD controller methods #
# #
# Note: add skip_before_action if you want to ignore any of the #
# above action to be loaded from module #
##################################################################
@VishalTaj
VishalTaj / git-deployment.md
Created February 7, 2019 12:10 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.

@VishalTaj
VishalTaj / slack.rb
Created April 11, 2019 13:55
Slack Notification in ruby
require 'net/http'
class Slack
attr_accessor :message, :channel, :status
BASE_URL = 'your base url goes here'
HEX_COLORS = {
success: '#7CD197',
error: '#BB0000',
@VishalTaj
VishalTaj / db_backup.rb
Last active April 11, 2019 14:01
A Database Backup module for MongoId in Rails
require 'slack'
##################################################################
# This module take cares of Database backups #
# #
# Note: please add and configure slack lib which you get in my #
# gist list to enable slack configration #
##################################################################
module DbBackup