Skip to content

Instantly share code, notes, and snippets.

View headsrooms's full-sized avatar
🦊

Pablo Cabezas headsrooms

🦊
  • SNGULAR
  • Madrid
  • 21:33 (UTC +02:00)
View GitHub Profile
@starenka
starenka / .gitignore
Created September 18, 2011 20:02
fabfile to deploy flask app to nginx/supervisor/uwsgi stack
.idea/*
*.pyc
@zenorocha
zenorocha / README.md
Last active May 28, 2024 08:23
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@bpo
bpo / eval-hello.sh
Last active November 2, 2022 19:26
Redis Lua examples
redis-cli EVAL "$(cat hello.lua)" 0
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active June 10, 2024 15:37
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@davfigue
davfigue / fabfile.py
Last active June 28, 2019 04:25
Fabric deploy script for 'django + uwsgi + nginx'
#
# A fabric deploy script for a django project using uwsgi + nginx (is debian/ubuntu focused)
#
# The nginx virtual host conf and uwsgi.ini should reside in the project root:
# - virtual host conf filename should be: PROJECT_NAME_nginx.conf
# - uwsgi conf filename should be: uwsgi.ini
#
# The deployment is mercurial based, but the script requires little changes for using git
# deployment works as follow:
# $ fab (devel|staging|production) install_system_deps #only once
import macros
proc procToLambda(input: PNimrodNode): PNimrodNode {.compiletime.} =
# Ident !"foo"
# Empty
# Empty
# FormalParams
# Ident retType
# IdentDefs
# ...
@timothyrenner
timothyrenner / tweet_utils.py
Last active July 29, 2021 22:32
Python Utilities for Tweets
from datetime import datetime
import string
from nltk.stem.lancaster import LancasterStemmer
from nltk.corpus import stopwords
#Gets the tweet time.
def get_time(tweet):
return datetime.strptime(tweet['created_at'], "%a %b %d %H:%M:%S +0000 %Y")
@benbacardi
benbacardi / gist:227f924ec1d9bedd242b
Last active July 15, 2024 07:58
Django reverse with a querystring
from django.utils.http import urlencode
def reverse_querystring(view, urlconf=None, args=None, kwargs=None, current_app=None, query_kwargs=None):
'''Custom reverse to handle query strings.
Usage:
reverse('app.views.my_view', kwargs={'pk': 123}, query_kwargs={'search': 'Bob'})
'''
base_url = reverse(view, urlconf=urlconf, args=args, kwargs=kwargs, current_app=current_app)
if query_kwargs:
return '{}?{}'.format(base_url, urlencode(query_kwargs))
@PurpleBooth
PurpleBooth / README-Template.md
Last active July 22, 2024 02:29
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@gaspardzul
gaspardzul / AngularDjagoConfig.js
Last active June 2, 2016 22:36
Este Gist te propone una configuración para trabajar AngularJS en conjunto con Django.
/**
* Created by gaspar on 22/sept/15.
*/
//angularJS
(function () {
var app = angular.module('app',
//ejemplo de algun controlador
['app.mainController']
);