Skip to content

Instantly share code, notes, and snippets.

Avatar
🌍
xaviesteve.com

Xavi Esteve luckyshot

🌍
xaviesteve.com
View GitHub Profile
@luckyshot
luckyshot / apache-commands.sh
Last active Mar 17, 2021
Apache Commands OSX (Local environment)
View apache-commands.sh
# OSX / Linux
sudo apache2ctl -S (tests config)
sudo apachectl -k restart
sudo code /usr/local/etc/httpd/httpd.conf
sudo code /usr/local/etc/httpd/extra/httpd-vhosts.conf
sudo code /etc/hosts
code /usr/local/etc/php/7.2/php.ini
ErrorLog "/usr/local/var/log/httpd/error_log"
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active Apr 20, 2021
What I Wish I'd Known About Equity Before Joining A Unicorn
View what-i-wish-id-known-about-equity-before-joining-a-unicorn.md

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

View growth_accounting_and_ltv.sql
with
dau as (
-- This part of the query can be pretty much anything.
-- The only requirement is that it have three columns:
-- dt, user_id, inc_amt
-- Where dt is a date and user_id is some unique identifier for a user.
-- Each dt-user_id pair should be unique in this table.
-- inc_amt represents the amount of value that this user created on dt.
-- The most common case is
-- inc_amt = incremental revenue from the user on dt
@luckyshot
luckyshot / gist:4770337
Last active Dec 12, 2015
Add target blank and track in Google Analytics to outgoing links
View gist:4770337
// Add target blank and track outgoing links in Google Analytics
// Method 1 (recommended): Event delegation. Track as Event.
// 'click'
// element and class names (i.e. a.button)
// href value clicked
$('body').on('click', function( e ) {
var target = $(e.target);
if ( target.tag == 'A' )
{
@murtaugh
murtaugh / 1. single-line.html
Last active Jan 4, 2021
Blockquote patterns for ALA
View 1. single-line.html
<figure class="quote">
<blockquote>It is the unofficial force—the Baker Street irregulars.</blockquote>
</figure>
@ndarville
ndarville / business-models.md
Last active Mar 27, 2021
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.
View business-models.md

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@JeffreyWay
JeffreyWay / set-value.md
Created Jul 28, 2012
PHP: Set value if not exist
View set-value.md

You know how, in JavaScript, we can set a value to a variable if one doesn't, like this:

name = name || 'joe';

This is quite common and very helpful. Another option is to do:

name || (name = 'joe');
@vyatri
vyatri / MimeMailParser.class.php
Created Apr 24, 2011
This class allows you to receive and parse email in PHP efficiently and effortlessly.
View MimeMailParser.class.php
<?php
require_once('attachment.class.php');
/**
* Fast Mime Mail parser Class using PHP's MailParse Extension
* @author gabe@fijiwebdesign.com
* @url http://www.fijiwebdesign.com/
* @license http://creativecommons.org/licenses/by-sa/3.0/us/
* @version $Id$
@jakebellacera
jakebellacera / ICS.php
Last active Apr 19, 2021
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
View ICS.php
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*