Skip to content

Instantly share code, notes, and snippets.

View sanampatel's full-sized avatar
💡
Something quite cool is coming up!

Sanam Patel sanampatel

💡
Something quite cool is coming up!
View GitHub Profile
@sanampatel
sanampatel / csvimport.sql
Last active July 24, 2017 11:20
Import CSV file into MySQL
LOAD DATA LOCAL INFILE '<file path here>' INTO TABLE <table name here>
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
(col1, col2, col3, col4, col5...);
/*
Also add below line to skip first header line from the CSV file
IGNORE 1 LINES
@sanampatel
sanampatel / 0_reuse_code.js
Created July 24, 2017 09:36
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@sanampatel
sanampatel / database_change.sql
Last active August 17, 2017 13:49
Move table from one database to another
alter table my_old_db.mytable rename my_new_db.mytable
@sanampatel
sanampatel / atoz.html
Created August 22, 2017 11:01
A to Z Buttons
<div class="uk-button-group uk-grid-small uk-text-center" uk-grid>
<li class="uk-button uk-button-default uk-button-small">A</li>
<li class="uk-button uk-button-default uk-button-small">B</li>
<li class="uk-button uk-button-default uk-button-small">C</li>
<li class="uk-button uk-button-default uk-button-small">D</li>
<li class="uk-button uk-button-default uk-button-small">E</li>
<li class="uk-button uk-button-default uk-button-small">F</li>
<li class="uk-button uk-button-default uk-button-small">G</li>
<li class="uk-button uk-button-default uk-button-small">H</li>
<li class="uk-button uk-button-default uk-button-small">I</li>
@sanampatel
sanampatel / jquery-url-parameter.js
Created September 4, 2017 17:23
URL Parameter with jQuery
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
@sanampatel
sanampatel / js-url-parameter.js
Created September 4, 2017 17:26
Get URL parameter with JavaScript!
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
#!/bin/bash
cd 'h:/homestead' #replace with directory of homesteadinstall
vagrant up
vagrant ssh
$SHELL
#!/bin/bash
cd 'h:/homestead' #path to your homestead
vagrant halt
$SHELL
@sanampatel
sanampatel / netlify.toml
Last active July 26, 2019 16:31
netlify.toml file configuration for Jigsaw production publish on Netlify without npm
[build]
command = "./vendor/bin/jigsaw build production"
publish = "build_production"
[build.environment]
PHP_VERSION=7.2
# Just use major releases like 7.1, 7.2, 7.3
@sanampatel
sanampatel / laravel_deploy.txt
Last active July 31, 2024 10:37
Laravel Deploy Script after git pull
# GIT MERGE OPTIONS DEPENDING HOSTING OR DEPLOYMENT PROVIDERS
# git checkout -- .
# git checkout .
# git merge
# php artisan down || true
# Put the application into maintenance / demo mode
php artisan down
# GIT Clear current generated files so can pull new ones