Skip to content

Instantly share code, notes, and snippets.

View allanfreitas's full-sized avatar
🏠
Working from home

Allan Freitas allanfreitas

🏠
Working from home
View GitHub Profile
@allanfreitas
allanfreitas / gist:b0576c118979e650299d5d1d8a0602e9
Created June 30, 2016 12:54 — forked from andreia/gist:3876449
Symfony2: Easiest way to add an * to required field labels
/* By default, required field labels are rendered with the "required" class */
.required:after {
content: "*";
}
@allanfreitas
allanfreitas / gist:7f5e4d88c0e6228f450f7fb59644470a
Created June 30, 2016 12:50 — forked from andreia/gist:3354204
ORACLE: Show size in Kb of BLOB fields
SELECT round(DBMS_LOB.getlength(A.FILE)/1024) KB FROM MY_TABLE A
import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
},
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };
@allanfreitas
allanfreitas / launch_sublime_from_terminal.markdown
Created June 23, 2016 10:10 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@allanfreitas
allanfreitas / mac-apps.md
Created May 4, 2016 19:01 — forked from erikreagan/mac-apps.md
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@allanfreitas
allanfreitas / lamp-stack-osx-virtualhostx.md
Created May 3, 2016 15:26 — forked from pwenzel/lamp-stack-osx-virtualhostx.md
LAMP stack on OSX with Homebrew, built-in Apache, multiple PHP versions, VirtualhostX optional

This guide shows how to set up a PHP and MySQL development environment using OSX's built-in Apache, using Homebrew to install necessary components. With this strategy, you can use different versions of PHP for certain virtual hosts.

VirtualHostX is a convenient way to manage development sites, but not required.

Install PHP and MySQL with Homebrew

brew update
brew install php56
brew install php56-mcrypt
brew install mysql
@allanfreitas
allanfreitas / macosx-install-php-oracle-oci8.md
Created May 3, 2016 14:06 — forked from gido/macosx-install-php-oracle-oci8.md
install Oracle PHP Extension (oracle OCI8) - instantclient for Mac OS 10.8 - homebrew environnement

Installation

This procedure is tested on Mac OS X 10.8 with Developpers tools installed (xCode).

PHP 5.4 installed with Homebrew.

Update: I wrote a blog post about this.

Preparation

Download the following files from Oracle website (yes, you need to create an account and accept terms):

@allanfreitas
allanfreitas / redis-delkeys.sh
Last active April 5, 2016 22:11 — forked from jdp/redis-delkeys.sh
Delete keys matching a pattern from Redis
#!/bin/sh
#
# Usage: ./redis-delkeys.sh [-h host] [-p port] [-n db] pattern
#
# Matches keys with the KEYS command matching pattern
# and deletes them from the specified Redis DB.
set -e
HOST="localhost"
@allanfreitas
allanfreitas / trello-to-newsletter.py
Created April 3, 2016 22:54 — forked from jefftriplett/trello-to-newsletter.py
Trello to Newsletter builder
"""
Trello to Newsletter builder
This is heavily inspired by: https://changelog.com/trello-as-a-cms/
To install:
pip install click cached_property markdown py-trello
To run:
export TRELLO_APP_KEY=''
@allanfreitas
allanfreitas / dashboard.html
Created April 2, 2016 21:21 — forked from robinwarren/dashboard.html
Trello dashboard using Bootstrap and JQuery
<html>
<head>
<title>A Trello Dashboard</title>
<link rel="stylesheet" media="screen" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h1>Trello Dashboard</h1>
<form class="form-horizontal" id="boards_form">