Skip to content

Instantly share code, notes, and snippets.

@sinanatici
sinanatici / deploy.sh
Created September 26, 2019 19:23 — forked from BenSampo/deploy.sh
Laravel deploy script
# Change to the project directory
cd /home/forge/domain.com
# Turn on maintenance mode
php artisan down
# Pull the latest changes from the git repository
# git reset --hard
# git clean -df
git pull origin master
/** copied and changed from: https://www.emailonacid.com/blog/article/email-development/html_boilerplate **/
/****** EMAIL CLIENT BUG FIXES - BEST NOT TO CHANGE THESE ********/
.ExternalClass {width:100%;} /* Forces Outlook.com to display emails at full width */
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
line-height: 100%;
} /* Forces Outlook.com to display normal line spacing, here is more on that:
http://www.emailonacid.com/forum/viewthread/43/
*/
@sinanatici
sinanatici / clean-kitchen-sink.html
Last active May 18, 2017 23:14
Clean Boostrap 3.3.7 Kitchen Sink / Elements. Sometimes, especially testing bootstrap in wordpress pages etc.
<!-- Copied from https://github.com/mindsharelabs/bootstrap-kitchen-sink/blob/master/kitchen-sink.html -->
<div class="jumbotron">
<h1>Kitchen Sink</h1>
<p>A quick preview of everything Bootstrap has to offer.</p>
<p><a class="btn btn-primary btn-large">Learn more &raquo;</a></p>
</div>
<div class="row">
<div class="col-lg-6">
<div class="panel panel-default" id="headings">
<div class="panel-heading">Headings</div>
@sinanatici
sinanatici / woocommerce-settings-tab-demo.php
Created May 10, 2017 18:44 — forked from BFTrick/woocommerce-settings-tab-demo.php
A plugin demonstrating how to add a WooCommerce settings tab.
<?php
/**
* Plugin Name: WooCommerce Settings Tab Demo
* Plugin URI: https://gist.github.com/BFTrick/b5e3afa6f4f83ba2e54a
* Description: A plugin demonstrating how to add a WooCommerce settings tab.
* Author: Patrick Rauland
* Author URI: http://speakinginbytes.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify
@sinanatici
sinanatici / functions.php
Created March 16, 2017 17:46 — forked from kloon/functions.php
WooCommerce 2.1 Add confirm password field on My Account register form
<?php
// Add the code below to your theme's functions.php file to add a confirm password field on the register form under My Accounts.
add_filter('woocommerce_registration_errors', 'registration_errors_validation', 10,3);
function registration_errors_validation($reg_errors, $sanitized_user_login, $user_email) {
global $woocommerce;
extract( $_POST );
if ( strcmp( $password, $password2 ) !== 0 ) {
return new WP_Error( 'registration-error', __( 'Passwords do not match.', 'woocommerce' ) );
}
@sinanatici
sinanatici / reset.css
Last active January 26, 2017 18:36
CSS Reset scenario for mailings
<style type="text/css">
/* I have copied from(https://gist.githubusercontent.com/simonausten/a6ec5331e6955ce2aecd/raw/235f85d42b6948911ea03b508dbdce7317c7e993/reset.css) most of all, and added some new necessary styles. Thanks simonausten */
/****** EMAIL CLIENT BUG FIXES - BEST NOT TO CHANGE THESE ********/
.ExternalClass {
width: 100%;
}
/* Forces Outlook.com to display emails at full width */
@sinanatici
sinanatici / number-input-tweak.js
Created December 16, 2016 21:37 — forked from GavinJaynes/number-input-tweak.js
Change WooCommerce number input ( Quantity ) to use custom styles using JavaScript. This can be used for any number field with the step attribute.
// Nominate the containing selector
var parentSelector = $('.quantity');
// If it's on the page
if( parentSelector.length ) {
// Get the original HTML
var numberInputs = parentSelector.html();
// Change number to text
var textInputs = numberInputs.replace('type="number"', 'type="text"');
// Plus button
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Google Maps Multiple Markers</title>
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.1.min.js"></script>
</head>
<body>
<div id="map" style="width: 500px; height: 400px;"></div>