Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

José Luis SalahAdDin

🎯
Focusing
View GitHub Profile
@SalahAdDin
SalahAdDin / dango.po
Created August 26, 2015 05:28
Local Turco
View dango.po
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
@SalahAdDin
SalahAdDin / gist:4044db11a13c56a977fc
Last active August 29, 2015 14:06
Funciones básicas para enviar mensajes de acuerdo a las noticias.
View gist:4044db11a13c56a977fc
from django.core.mail import send_mail, mail_admins
from django.db import models
from django.template.defaultfilters import slugify
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from ckeditor.fields import RichTextField
from subtopic.models import Subtopic
@SalahAdDin
SalahAdDin / news.models.py
Created October 20, 2014 19:49
Aquí está el modelo de mi app.
View news.models.py
from django.core.mail import send_mail, mail_admins
from django.db import models
from django.template.defaultfilters import slugify
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from ckeditor.fields import RichTextField
from subtopic.models import Subtopic
@SalahAdDin
SalahAdDin / base_search.html
Last active August 29, 2015 14:08
Usando haystack para hacer búsquedas normales y por fechas, y filtrando por tres campos.
View base_search.html
<!--Contenido-->
<main>
<div class="row">
<!-- Left Wrapper Seccion listas -->
<div class="show-for-large-up small-1 large-3 columns left-wrapper">
<div class="tabs-content">
{% include 'search/search_menu.html' %}
</div>
</div>
<!--Contenido -->
@SalahAdDin
SalahAdDin / feed.py
Last active August 29, 2015 14:10
News rss file
View feed.py
from django.contrib.syndication.views import Feed
from django.contrib.syndication.views import FeedDoesNotExist
from django.shortcuts import get_object_or_404
from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed
from .models import New
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404
from django.http import HttpResponseForbidden
class MediaRSSFeed(Rss201rev2Feed):
@SalahAdDin
SalahAdDin / settings.py
Last active August 29, 2015 14:10
Configuración para nginx
View settings.py
MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), "tiempoturco", "statics", "media")
#STATIC_ROOT = os.sep.join(os.path.abspath(__file__).split(os.sep)[:-2] + ['statics/static_only'])
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), "tiempoturco", "statics", "static_only", )
#STATICFILES_DIRS = os.sep.join(os.path.abspath(__file__).split(os.sep)[:-2] + ['statics/static'])
STATICFILES_DIRS = (os.path.join(os.path.dirname(BASE_DIR), "tiempoturco", "statics", "static"),)
@SalahAdDin
SalahAdDin / cepstrum.m
Created December 6, 2014 01:42
Encontrando los coeficientes cepstrales.
View cepstrum.m
function [c] = cepstrum(segs)
%Encontrar los coeficientes cepstrales de cada segmento
[M,N] = size(segs);
% M filas, N columas,
% Definir Mo=output frame size(# de %frecuencias a las que se aplica FFT)
[c] = zeros(M,10);
% Inicialiando el vector para guardar los coeficientes cepstrales.
% P=10
@SalahAdDin
SalahAdDin / FlowMineListener.cpp
Last active August 29, 2015 14:11
Mina de Proximidad para CryEngine
View FlowMineListener.cpp
#include "StdAfx.h"
#include "Nodes\G2FlowBaseNode.h"
class CFlowMineListener : public CFlowBaseNode < eNCT_Instanced >, public IEntityEventListener
{
public:
CFlowMineListener(SActivationInfo *pActInfo):
pTargetEnt(nullptr)
{
@SalahAdDin
SalahAdDin / 400.html
Created January 14, 2015 18:05
Wagtail Template Errors
View 400.html
{% extends "error_base.html" %}
{% load i18n %}
{% block titletag %}{% trans 'Client Error' %}{% endblock %}
{% block body_class %}template-400{% endblock %}
{% block content %}
% trans "There's been an error. We have problems with customer requests, ie, of your computer, please check it." %}
{% endblock %}
{% block error %}<span>400</span>{% trans 'error'|capfirst %}{% endblock %}
@SalahAdDin
SalahAdDin / gnmenu1.js
Last active August 29, 2015 14:20
Script for gnmenu: google nexus menú.
View gnmenu1.js
/**
* gnmenu.js v1.0.0
* http://www.codrops.com
*
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*
* Copyright 2013, Codrops
* http://www.codrops.com
*/