Skip to content

Instantly share code, notes, and snippets.

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

Guga Guichard gustavoguichard

🏠
Working from home
View GitHub Profile
development: &defaults
ADMIN_EMAIL: 'gustavoguichard@gmail.com'
test: &development
<<: *defaults
production:
<<: *defaults
@gustavoguichard
gustavoguichard / gist:7e2bac7340c9494fc735
Last active August 29, 2015 14:19
BS Dropdown in React
import React from 'react';
import $ from 'jquery';
require('bootstrap-webpack');
var Dropdown = React.createClass({
componentDidMount() {
$(this.getDOMNode).on('shown.bs.dropdown', function(event){
this.props.onChange(true);
}.bind(this));
$(this.getDOMNode).on('hidden.bs.dropdown', function(event){
@gustavoguichard
gustavoguichard / gist:e2f88c0adb157f194008
Created June 10, 2015 13:51
Bootstrap Dropdown inside React
////////////////////////////////////////////////////////////////////////////////
// Exercise:
//
// http://getbootstrap.com/javascript/#dropdowns
//
// Wrap Bootstrap Dropdown in a React component and just rely on the declarative
//
// Got extra time?
//
// Allow the parent to manage the state of the dropdown
@gustavoguichard
gustavoguichard / gist:3948216
Created October 24, 2012 19:17
Wordpress query
<?php $my_query = new WP_Query('showposts=3&tag=tag'); ?>
<?php if($my_query->have_posts()) : ?><?php while($my_query->have_posts()) : $my_query->the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif; wp_reset_query(); ?>
@gustavoguichard
gustavoguichard / gist:3948168
Created October 24, 2012 19:07
Wordpress sublime project config
{
"folders":
[
{
"path": "/Users/Guga/Sites/sim/wp-content/themes/Sim",
"file_exclude_patterns": ["*.pot", "*.mo", "*.txt"],
"folder_exclude_patterns": [".sass-cache", "images"]
},
{
"path": "/Users/Guga/Sites/sim/wp-content/plugins",
@gustavoguichard
gustavoguichard / gist:3959974
Created October 26, 2012 17:06
Future Sass gem
// This code isn't yet fully tested
// CUSTOM HTML RESETS
html
text-rendering: optimizeLegibility
-webkit-font-smoothing: antialiased
= css-techniques($font-size: 16)
html
@gustavoguichard
gustavoguichard / gist:4024379
Created November 6, 2012 12:36
Use case of my gem
.copyright
+outerRow
display: block
font-size: relative-size(11,14)
+move(68px, bottom)
+decorative-content
+sprite-replace("bird")
bottom: 48px
+absolute-centering(30px, right, 320px)
+context(".contact-page")
@gustavoguichard
gustavoguichard / gist:4024390
Created November 6, 2012 12:40
Compiled CSS
.copyright {
width: 1000px;
max-width: 100%;
min-width: 768px;
margin: 0 auto;
display: block;
font-size: 0.78571em;
bottom: -68px;
position: relative;
}
@gustavoguichard
gustavoguichard / page.php
Created November 6, 2012 17:00
A simple page.php
<?php get_header(); ?>
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<article>
<header>
<?php $page_quoted_title = get_post_meta($post->ID, 'page_quoted_title', true);?>
<h2><?php if($page_quoted_title){echo nl2br($page_quoted_title);} else {the_title();} ?></h2>
</header>
<?php the_content();?>
</article>
<?php $extra_content = get_post_meta($post->ID, 'extra_content', true);?>
@gustavoguichard
gustavoguichard / cria-page.php
Created November 6, 2012 17:04
WP Template page example
<?php
/**
* Template Name: Cria Page
*
* @package WordPress
* @subpackage Cria Ideias
* @since Gustavo Guichard 2012
*/
get_header(); ?>