Skip to content

Instantly share code, notes, and snippets.

View solancer's full-sized avatar
🎯
Focusing

Srinivas Gowda solancer

🎯
Focusing
View GitHub Profile
@solancer
solancer / bash_rc
Created October 7, 2017 11:58
Composer On MAMP
PHP_VERSION=`ls /Applications/MAMP/bin/php/ | sort -n | tail -1`
alias composer='php /Applications/MAMP/bin/php/${PHP_VERSION}/bin/composer.phar'
export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH export
@solancer
solancer / php-mass-mailer.php
Created October 1, 2017 00:53 — forked from jonaslejon/php-mass-mailer.php
PHP Mass Mailer
<?php
/*
The code below was found during a forensic investigation. It seems to be a mass mailer that is using the PHPMailer class to send mail
from compromised web hosting providers.
The "password" is 5307c392-ad5e-4909-adec-c9fd12572686, see below.
Investigation was made by Jonas Lejon <jonas.githubgist at- triop.se>
The signature for PHP.Trojan.Mailer-1 can only find the packed version of this file.
@solancer
solancer / contact-ajax.js
Created September 30, 2017 20:52
Generic contact form AJAX function
$(document).ready(function() {
$("#contactForm").submit(function(e) {
e.preventDefault();
var o = $(this).serializeArray(),
t = $(this).attr("action"),
i = $("#contactFormResponse"),
n = $("#cfsubmit");
n.text();
return n.text("Sending..."), $.ajax({
url: t,
@solancer
solancer / breakpoints.css
Created September 13, 2017 07:46
CSS Grid Breakpoints
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}
/* Extra Small Devices, Phones */
@media only screen and (min-width : 480px) {
@solancer
solancer / Laravel-Perm.sh
Last active December 19, 2017 16:37 — forked from ClaudioVarandas/laravel_perm.sh
Laravel permissions
# add sudo user to www-data group
# usermod on your user. So that would be
sudo usermod -aG www-data srinivas
# set perms with sudo user in accordance with apache user
sudo chown -R srinivas:www-data .
# change group perms of storage and cache folder to exlcusively support only apache user
sudo chgrp -R www-data storage bootstrap/cache
# declare user and group permissions on the same
sudo chmod -R ug+rwx storage bootstrap/cache
# unmask hack to set www-data for newly created files
@solancer
solancer / bootstrap-offset-col-right.css
Created August 10, 2017 22:25
offset to right css for bootstrap cause by default only left offset is possible
.col-xs-offset-right-12 {
margin-right: 100%;
}
.col-xs-offset-right-11 {
margin-right: 91.66666667%;
}
.col-xs-offset-right-10 {
margin-right: 83.33333333%;
}
.col-xs-offset-right-9 {
@solancer
solancer / wget_script.sh
Created April 23, 2017 14:46
Wget scrape images from website
wget -nd -H -p -A jpg,jpeg,png,gif -e robots=off example.com
@solancer
solancer / readme.md
Created March 13, 2017 10:56 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@solancer
solancer / Install Ruby Gems on Mac OS X without sudo
Created January 3, 2017 15:21
Install Ruby Gems on Mac OS X without sudo
Install Ruby Gems on Mac OS X without sudo
1. Add GEM_HOME to your .bash_profile
For example, nano ~/.bash_profile and add
export GEM_HOME=/Users/srinivas/.gem where the path is to your own Home folder
2. Add the gem executables to your system path
Also in .bash_profile, add
@solancer
solancer / htaccess.expires.headers
Created December 13, 2016 21:01
htaccess expires headers
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 year"
# Data interchange
ExpiresByType application/atom+xml "access plus 1 hour"