Skip to content

Instantly share code, notes, and snippets.

View diegotoral's full-sized avatar

Diego Toral diegotoral

View GitHub Profile
@diegotoral
diegotoral / Preferences.json
Created February 21, 2014 16:46
Sublime Text 3 - User Preferences
{
"word_wrap": "true",
"color_scheme": "Packages/Theme - Phoenix/Color Scheme/Clouds Midnight.tmTheme",
"ensure_newline_at_eof_on_save": true,
"font_size": 10,
"highlight_line": true,
"ignored_packages":
[
"Handlebars",
"Jade",
@app.route('/<ObjectId:task_id>')
def show_task(task_id):
task = mongo.db.tasks.find_one_or_404(task_id)
return render_template('task.html', task=task)
describe('NewActivityView', function() {
var view;
beforeEach(function() {
jasmine.getFixtures().fixturesPath = '';
loadFixtures('index.html');
view = new app.NewActivityView();
});
it('should bind $el to the right DOM element', function() {
# -*- coding: utf-8 -*-
import random
leet = {
'a': ['4', '/\\', '@', '/-\\', '^', '\xc3\xa4', '\xc2\xaa', 'aye'],
'b': ['8', '6', '|3', '\xc3\x9f', 'P>', '|:'],
'c': ['[', '\xc2\xa2', '<', '('],
'd': ['|))', 'o|', '[)', 'I>', '|>', '?'],
'e': ['3', '&', '\xc2\xa3', '\xc3\xab', '[-', '\xe2\x82\xac', '\xc3\xaa', '|=-'],
@diegotoral
diegotoral / elasticsearch.rb
Last active August 29, 2015 14:09
ElasticSearch 1.2.4 (Mac OS brew formule)
require 'formula'
class Elasticsearch < Formula
homepage 'http://www.elasticsearch.org'
url 'https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.2.4.tar.gz'
sha1 'c8bbe1f1975ffb6774744fadd0abb78616e96904'
head do
url 'https://gist.github.com/diegotoral/ec2a520c7087a6dea5ed'
depends_on 'maven'
@diegotoral
diegotoral / bftextview2.h
Created May 27, 2012 17:12
Bluefish TextView
/* Bluefish HTML Editor
* bftextview2.h
*
* Copyright (C) 2008,2009,2010,2011,2012 Olivier Sessink
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
@diegotoral
diegotoral / gmenu.js
Created June 2, 2012 21:00
GMenu and Applcation example
#!/usr/bin/gjs
const Gio = imports.gi.Gio;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;
const App = new Lang.Class ({
Name : "App",
#!/usr/bin/python
import PPMaze
from gi.repository import GObject
from gi.repository import Clutter
class PPGuy(Clutter.Actor):
"""PPGuy class - base class for some entities of the game"""
@diegotoral
diegotoral / for.c
Created March 8, 2013 16:43
Never ends!
#include <stdio.h>
int main()
{
for( ; 1; )
printf("Funcionaaa!!!!\n");
return 0;
}
#include <stdio.h>
// Arestas/Alfabeto
enum Arestas
{
A, B, C, D, E,
10c, 50c, 100c
}
//Estados do automato