Skip to content

Instantly share code, notes, and snippets.

View Luis-Palacios's full-sized avatar
🎯
Focusing

Luis Palacios Luis-Palacios

🎯
Focusing
View GitHub Profile
@Luis-Palacios
Luis-Palacios / 1.python_dependencies.bash
Last active October 8, 2015 03:49
Installing and configuring ubuntu server for django application
#You will probably need root privilegies so use sudo before any command or login as root
#Lets update everything before we go
apt-get update
apt-get upgrade
#Now for the python dependencies
#You need all of this in order for python to compile with full power
@Luis-Palacios
Luis-Palacios / djangofor.xml
Created July 21, 2015 05:25
Example of snippet for django template
<CodeSnippet Format="1.1.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<Header>
<Title>form</Title>
<Author>Microsoft Corporation</Author>
<Shortcut>form</Shortcut>
<Description>Markup snippet for a HTML form</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
@Luis-Palacios
Luis-Palacios / Nginx gzip settings
Created June 9, 2015 04:33
Nginx gzip settings
gzip on;
gzip_http_version 1.0;
gzip_proxied any;
gzip_min_length 500;
gzip_disable "MSIE [1-6]\.";
gzip_vary on;
gzip_comp_level 6;
# gzip_buffers 16 8k;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
@Luis-Palacios
Luis-Palacios / Django-postgres configuration example
Created June 1, 2015 18:38
An example to show the configuration for database with django and postgres
import dj_database_url
DATABASES= {'default':dj_database_url.config(
default='postgres://DbUser:strongPasword@yourhost/dbName'
)}
@Luis-Palacios
Luis-Palacios / Environment Variable Connection String
Created January 5, 2015 04:10
Chossing connection string according to Environment Variable
private static string GetConnectionString()
{
var environmentVariable = Environment.GetEnvironmentVariable("FunctionalTests");
return environmentVariable == null
? ConfigurationManager.ConnectionStrings["SchoolContext"].ConnectionString
: ConfigurationManager.ConnectionStrings["SchoolContext-FunctionalTests"].ConnectionString;
}
//Si esta setiado el valor de la variable de entorno FunctionalTests usa la base de datos para la prueba