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
from django.db import models
class Categoria(models.Model):
nome = models.CharField(max_length=200)
slug = models.SlugField(unique=True, blank=True, null=True)
parent = models.ForeignKey('self', blank=True, null=True, related_name='child')
#include<stdio.h>
#include<stdlib.h>
#include<locale.h>
#include<string.h>
int main(void){
setlocale(LC_ALL, "Portuguese");
int num;
int gol1;
@RodolfoSilva
RodolfoSilva / criando-um-microblog-com-django.md
Created October 12, 2015 23:34
Criando um microblog com Django

Criando um microblog com Django

Vamos construir um sistema de microblog utilizando Django, passo a passo, na prática.

Nesse projeto eu irei utilizar o Django 1.8, PostgreSQL, Elasticsearch e um pouco de AngularJS.

Conteúdo

@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:

@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 / 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) {
<?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>
<?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
include_once TEMPLATEPATH . '/partials/admin.php';
$theme_admin = new ThemeAdmin();
@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>