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 / 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 / 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 / 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 / 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 / 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 / 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 / .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 / package.json
Created April 13, 2018 23:55 — forked from addyosmani/package.json
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
@saxenap
saxenap / gist:8293d0e9e379896d501a8f02cd8b97c0
Created April 21, 2018 18:59 — forked from abhishekkr/gist:4165864
shell.func-download-all-files-from-any-GITHUB-GIST-URL {updated to *new* gist}
# Usage Example: $ ddl-gist 'https://gist.github.com/4137843' ~/Downloads/gists
# save the gist files at that URL in ~/Downloads/gists
##
ddl_gist(){
if [ $# -ne 2 ];
then
echo 'Failed. Syntax: $> ddl-gist GITHUB_GIST_URL DOWNLOAD_PATH'
return
fi
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1