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

#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 / GridStream.js
Created March 1, 2016 19:25 — forked from psi-4ward/GridStream.js
NodeJS MongoDB-GridFS Video range stream example Lets your browser seek/jump wihin the video-playback.
var app = require('express')();
var GridStore = require('mongodb').GridStore;
var ObjectID = require('mongodb').ObjectID;
var MongoClient = require('mongodb').MongoClient;
var Server = require('mongodb').Server;
var dbConnection;
MongoClient.connect("mongodb://localhost:27017/ersatz?auto_reconnect", {journal: true}, function(err, db) {
dbConnection = db;
app.listen(3000);
@RodolfoSilva
RodolfoSilva / custom-error.js
Created April 28, 2016 11:31 — forked from justmoon/custom-error.js
Creating custom Error classes in Node.js
'use strict';
module.exports = function CustomError(message, extra) {
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
this.extra = extra;
};
require('util').inherits(module.exports, Error);
@RodolfoSilva
RodolfoSilva / object_create.js
Created April 29, 2016 03:03 — forked from badsyntax/object_create.js
Simple prototypal inheritance in node.js
/* This shows how to use Object.create */
/** BASE MODEL **********************************/
function BaseModel(collection) {
this.collection = collection;
}
BaseModel.prototype.getCollection = function() {
return this.collection;
@RodolfoSilva
RodolfoSilva / .gitignore
Created June 6, 2016 11:47 — forked from bergie/.gitignore
Node.js email handling examples
config.json
reading-image.png
@RodolfoSilva
RodolfoSilva / spotify_keybindings
Created November 16, 2016 01:28 — forked from jbonney/spotify_keybindings
Spotify - Linux key bindings. From XFCE / Ubuntu keyboard shortcuts configuration, assign the control command to their key. http://shkspr.mobi/blog/2011/12/linux-spotify-keybindings/
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" XF86AudioPlay
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop" XF86AudioStop
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" XF86AudioNext
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" XF86AudioPrevious