Skip to content

Instantly share code, notes, and snippets.

View selvinortiz's full-sized avatar
👋

Selvin Ortiz selvinortiz

👋
View GitHub Profile
@selvinortiz
selvinortiz / index.html
Last active December 16, 2015 20:59 — forked from matfish2/boilerplate.html
HTML:Boilerplate
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
@if(empty($title))
<title>Company</title>
@else
<title>{{ $title }} | Company</title>
@endif
<link rel="stylesheet" type="text/css" href="/css/reusify.css">
@selvinortiz
selvinortiz / ir.css
Created May 2, 2013 21:42
CSS:Image Replacement
.ir {
font: 0px/0px monospace;
text-shadow: none;
color: transparent;
}
@selvinortiz
selvinortiz / tools.md
Created May 4, 2013 06:50
DEV:Tool Reference

DEVELOPMENT TOOLS

This is a quick (somewhat) reference for tools we can use in our development workflow.

PHP

  • COMPOSER Package and Dependency management for PHP

    cd ~/Downloads

    curl -sS https://getcomposer.org/installer | php

@selvinortiz
selvinortiz / pdo.php
Created May 22, 2013 17:26 — forked from quoidautre/gist:3781733
PHP:PDO
<?php
// PDO Connection to MySQL
$conn = new PDO('mysql:host=localhost;dbname=yourdbname', 'username', 'password');
// PDO Connection to PostgreSQL
$conn = new PDO('pgsql:host=localhost;dbname=yourdbname', 'username', 'password');
// A quick Select Query with For Loop
foreach ($conn->query("SELECT * FROM profile") as $row)
echo $row['fullname'];
@selvinortiz
selvinortiz / gravatar.php
Created June 6, 2013 19:00
PHP:Gravatar
<?php
define('GRAVATAR', 'http://www.gravatar.com/avatar/');
/**
* Requesting an image from gravatar.com
*
* @param str email The email address to use
* @param str size The desired image size i.e: 120 (images are square)
* @param boo wrap Whether to wrap the image in an <img> tag
@selvinortiz
selvinortiz / path.php
Last active December 18, 2015 11:39
CRAFT:Path
<?php
namespace Craft;
/**
* @=Path: A wrapper for the Craft Path Service API
*
* Path allows you to access the API in a very flexible and elegant way.
*
* @author Selvin Ortiz
@selvinortiz
selvinortiz / load.php
Created June 17, 2013 08:59 — forked from jwage/SplClassLoader.php
PHP:Loader
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.
@selvinortiz
selvinortiz / env.php
Last active December 18, 2015 18:50
CRAFT:Env
<?php
/**
* @=ENV
*
* @author Selvin Ortiz (http://twitter.com/selvinortiz)
*
* 1. Define the craft path relative to this file
* 2. Define the domain name this site is running under
* 3. Define the ip address that requested this resource
* 4. Define the environment we are working under
@selvinortiz
selvinortiz / spamguard.html
Created July 3, 2013 00:22
SpamGuard:Test
{% extends "_abstract/master.twig" %}
{% set title = "Spam Guard" %}
{% set bodyId = "spamguard" %}
{% block content %}
{% if spam is defined %}
{% set email = spam.email %}
{% set author = spam.author %}
{% set content = spam.content %}
@selvinortiz
selvinortiz / flux.twig
Last active December 20, 2015 02:29
CRAFT:Flux
{% extends "_abstract/master.twig" %}
{% set bodyId = 'flux' %}
{% block content %}
{% set url = 'http://www.selvinortiz.com' %}
{%
set flux = craft.flux
.startOfLine()
.find('http')
.maybe('s')