Skip to content

Instantly share code, notes, and snippets.

View saxenap's full-sized avatar

Praveen Saxena saxenap

  • West Lafayette, IN
View GitHub Profile
@saxenap
saxenap / .gitconfig
Created March 14, 2018 02:59 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = [email protected]
username = pksunkara
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
@saxenap
saxenap / s3_example.php
Last active January 22, 2018 03:49 — forked from charlie-s/s3_example.php
S3 PHP Example (without an SDK)
<?php
class S3 {
private $key = 'ABC123';
private $secret = 'lolftw';
private $region = 'us-west-2';
private $bucket = 'examplebucket';
private $host = 's3.amazonaws.com';
public function uploadFile($file_path) {
@saxenap
saxenap / gist:596b5bf709856a677f03ed9397a36a0f
Created January 15, 2018 22:39 — forked from sheikhwaqas/gist:5577119
Install Apache / MySQL & PHP on a freshly created Red Hat Enterprise Linux Amazon EC2 Instance
# Login to your Amazon EC2 Instance via SSH.
# If you are logged in as root, you don't need to use the sudo command in the commands below.
# Update the current packages installed on the system
sudo yum upgrade
# Install the required packages before installing Apache / MySQL and PHP
sudo yum install gcc gcc-c++ autoconf automake pcre-devel \
libxml2-devel bzip2-devel libcurl-devel freetype-devel \
openldap-clients cyrus-sasl-devel openldap-devel \
@saxenap
saxenap / mysql_secure_installation.sh
Last active January 15, 2018 20:44 — forked from naillizard/mySQLSecure.sh
Automate mysql secure installation for Red Hat Enterprise Linux (RHEL) compatible distributions
#!/bin/bash
#
# Copyright (c) 2014-2017 Praveen Saxena <>
# License: BSD-3-Clause
#
# To get:
# rm -rf mysql_secure_installation && wget -O mysql_secure_installation https://gist.githubusercontent.com/saxenap/b84d67f63a5fc315c5895648438fd2d0/raw && chmod 777 mysql_secure_installation && ./mysql_secure_installation
#
# Automate mysql secure installation for Red Hat Enterprise Linux (RHEL) compatible distributions
#
@saxenap
saxenap / Gulpfile
Created March 24, 2016 10:43 — forked from davidnknight/Gulpfile
A well structured gulpfile that performs CSS, JS, image and PHP tasks with an abstract config.
Specifically, this gruntfile will perform the following.
- CSS:
-- Compile SCSS
-- Add vendor prefixes for the last 10 browser versions
- JS:
-- Run scripts through jshint to detect errors and potential problems in code.
-- Compile scripts to your destination folder in their original state. Use these in development environments as they'll be easier to debug with as their code doesn't exist on 1 line, nor is it obfuscated.
-- Minify and concatenate scripts into one all.min.js. Uglify will also obfuscate code if you set mangle to true, leave as false if using AngularJS.
@saxenap
saxenap / README.md
Created March 24, 2016 10:40 — forked from nodesocket/README.md
The perfect Gulp.js

The perfect gulp.js file

Tasks

serve

Runs a connect web server, serving files from /client on port 3000.

uglify-js

@saxenap
saxenap / Makefile
Last active April 10, 2016 22:27 — forked from avalanche123/Makefile
new PHP project Makefile
AUTHOR = AUTHOR
EMAIL = EMAIL
PROJECT = PROJECT
PROJECTNAMESPACE = PROJECTNAMESPACE
BUILDFILE = $(PROJECT).phar
SRCDIR = src
TESTDIR = tests
PHPUNITCONFIG = phpunit.xml.dist
BOOTSTRAP = bootstrap.php
PHPUNIT = vendor/bin/phpunit
@saxenap
saxenap / install node
Created March 10, 2016 17:00 — forked from guybrush/install node
install multiple nodejs versions, use same npm packages
#
# node ---------------> ~/.nvm/<node-version>/bin/node
# node-libraries -----> ~/.node_libraries
# node-binaries ------> ~/.node_binaries
#
aptitude install g++ curl libssl-dev apache2-utils make
git clone git://github.com/creationix/nvm.git ~/.nvm
vi ~/.bashrc
export PATH=$PATH:~/.node_binaries
NVM_DIR=$HOME/.nvm
@saxenap
saxenap / .htaccess
Created October 27, 2015 17:07 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@saxenap
saxenap / transform-html5.php
Last active September 15, 2015 18:20 — forked from bzerangue/transform-html5.php
PHP: XSLT Transformation to build HTML5 html output (use xhtml 1.0 strict as your settings in your XSLT stylesheet)
<?php
// Load the XML source
$xml = new DOMDocument;
$xml->load('XML_SOURCE_LINK_HERE');
// Load XSLT stylesheet
$xsl = new DOMDocument;
$xsl->load('XSL_STYLESHEET_PAGE_LINK_HERE');