Skip to content

Instantly share code, notes, and snippets.

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

Rodolfo Silva RodolfoSilva

🏠
Working from home
View GitHub Profile
{#
time can be any string acceptable by http://www.php.net/strtotime, the
template will output that time's month.
If you don't want to pass in a date you can set time like this:
{% set time = "now"|date("U") %}
{% set time = "December 2012"|date("U") %}
How ever you want to output items onto the calendar is a different issue,
but I'd assume pushing everything into an array numerically indexed by that day:
-- Example of how to include an if conditional in a where clause
-- We only want rows where a = 1 or 2 but only a = 2 if b = 4
-- table structure:
-- [ a | b ]
-- 1 4
-- 2 4
-- 1 5
-- 3 9
-- 2 7
<?php
/**
* Class do painel de administração do tema
* @author Rodolfo Silva <contato@rodolfosilva.com>
* @link http://rodolfosilva.com
*/
class ThemeAdmin
{
public function __construct()
{
@RodolfoSilva
RodolfoSilva / admin.php
Last active August 29, 2015 14:11
Método tema_config_page
<?php
/**
* Layout do painel
*/
public function theme_config_page()
{
?>
<div class="wrap">
<h2>Configurações do tema</h2>
<p>Pequena descrição sobre o tema e o painel de configurações do tema</p>
<?php
include_once TEMPLATEPATH . '/partials/admin.php';
$theme_admin = new ThemeAdmin();
<?php
/**
* Class do painel de administração do tema
* @author Rodolfo Silva <contato@rodolfosilva.com>
* @link http://rodolfosilva.com
*/
class ThemeAdmin
{
private $title = 'Configurações do meu tema';
private $name_id = 'config_theme';
<?php
public function themeOptionsPage()
{
// Carrega as opções
$this->options = get_option($this->name_id);
?>
<div class="wrap">
<h2><?php echo $this->title ?></h2>
<p>Pequena descrição sobre o tema e o painel de configurações do tema</p>
@RodolfoSilva
RodolfoSilva / run.js
Last active August 29, 2015 14:21
Executando o jogo kolor.moro.es
"use strict";
var interval_id;
var kolor_kolor = document.querySelector("#kolor-kolor");
var kolor_options = document.querySelector("#kolor-options");
var kolor_modal = document.querySelector("#kolor-end-block");
var kolor_start = document.querySelector("#kolor-start");
var kolor_restart = kolor_modal.querySelector("#kolor-restart");
var onBackgroundChange = function (color) {
[].forEach.call(kolor_options .querySelectorAll('li a'), function(a) {
if (a.style.backgroundColor == color) {
@RodolfoSilva
RodolfoSilva / gist:a4dffbc59b7caa956ed6
Created July 26, 2015 18:07
Compacta o último commit apenas com as modificações.
// Essencial para trabalhar com FTP
git diff -z --name-only HEAD^ | xargs --null git archive --output update.zip HEAD
@RodolfoSilva
RodolfoSilva / README.md
Created September 25, 2015 17:45 — forked from hilios/README.md
ngPageTitle - AngularJS page title service

$pageTitle

Allows to control the page title from the AngularJS route system, controllers or any other component through an injectable service.

ngPageTitle - Page title service (run tests)

To get started add the module to your app and configure the page title provider: