Skip to content

Instantly share code, notes, and snippets.

View marlenesco's full-sized avatar

David Foliti marlenesco

View GitHub Profile
@marlenesco
marlenesco / circular.js
Created May 27, 2015 08:40
Class for circular menu using jquery and hammer.js
var circular = function (selector) {
var circle = ((typeof selector == "string") ? $(selector) : selector);
if (typeof selector == "string") {
window.setTimeout(function () {
$(selector).parent().addClass('open');
}, 500);
}
var items = circle.children('li');
@marlenesco
marlenesco / Bootstrap 3 vertical divider
Created January 27, 2016 16:43
Bootstrap 3 vertical divider in less
.nav > li.divider {
display: none;
@media (min-width: @screen-sm) {
display: block;
& > a {
padding-left: 0;
padding-right: 0;
cursor: default;
&:hover,
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ERROR);
$hostname = '{imap.gmail.com:993/imap/ssl}INBOX';
$username = 'anaccount@gmail.com';
$password = 'password';
$inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error());
@marlenesco
marlenesco / MacOSXSierra:Brew+Apache+Mysql+PHPSwitcher+DNSMasq+SSL.md
Created December 22, 2017 17:08 — forked from andrewstobbe/MacOSXSierra:Brew+Apache+Mysql+PHPSwitcher+DNSMasq+SSL.md
Mac OSX Sierra : Brew Apache + Mysql + PHP Switcher + DNSMasq + SSL

Mac OSX Sierra : Brew Apache + Mysql + PHP Switcher + DNSMasq + SSL 👍

Things I had to do using Homebrew to get my local web dev environment back up and running after migration to OSX Sierra + Xcode 8.1.

Note: I used brew reinstall because I had already installed most of this previously under Yosemite. Probably better ways to do this, but this is what worked for me.

brew doctor

brew tap homebrew/dupes
brew tap homebrew/versions
@marlenesco
marlenesco / text-strike.less
Last active January 23, 2018 14:25
Bootstrap text stripe
.text-stripe {
position: relative;
&:before {
position: absolute;
content: "";
left: -0.1em;
top: 50%;
right: -0.1em;
border-top: .09em solid;
@marlenesco
marlenesco / DateUtils.php
Last active February 1, 2018 14:20
Get date range for week or month
<?php
/**
* Created by PhpStorm.
* User: david.foliti
* Date: 01/02/18
* Time: 11:46
*/
namespace CalendarDipBundle\Utils;
INSTALL SYMFONY APP IN A SUBFOLDER OF AN EXISTING SITE
http://www.yegods.it/2015/01/30/install-symfony-app-in-a-subfolder-of-an-existing-site/
Here a solution using virtual host Alias:
<VirtualHost *:80>
DocumentRoot "/var/www/html/vhosts/example.com/public_html"
ServerName www.example.com
<Directory "/var/www/html/vhosts/example.com/public_html">
@marlenesco
marlenesco / put-object-on-aws-s3.php
Created May 30, 2018 15:18 — forked from keithweaver/put-object-on-aws-s3.php
Upload an image/object to an AWS S3 Bucket using PHP
<?php
// Installed the need packages with Composer by running:
// $ composer require aws/aws-sdk-php
$filePath = "https://example.com/test.png";
require 'vendor/autoload.php';
$bucketName = 'YOUR_BUCKET_NAME';
$filePath = './YOUR_FILE_NAME.png';
@marlenesco
marlenesco / just-do-pattern.php
Last active September 21, 2018 15:10
ZipCode pattern generator
<?php
$patterns = [];
$data = json_decode(file_get_contents('http://i18napis.appspot.com/address/data'), true);
$countries = explode('~', $data['countries']);
foreach ($countries as $country) {
$data = json_decode(file_get_contents('http://i18napis.appspot.com/address/data/'.$country), true);
if (isset($data['zip'])) {
$patterns[$country] = $data['zip'];
}
@marlenesco
marlenesco / autoText
Last active January 21, 2020 10:04
Convert simple text in full html.Image links will convert in <IMG> tagsUrl links will convert in <A> tags
<?php
/**
* Convert simple text to full html
* Image links will convert in <IMG> tags
* Url links will convert in <A> tags
*
* @param string $str the text to convert
* @param string $cssClass css class for tags
* @param boolean $strip_tags init strip html tags