Skip to content

Instantly share code, notes, and snippets.

View eevmanu's full-sized avatar
🎯
focused

Manuel eevmanu

🎯
focused
View GitHub Profile
@eevmanu
eevmanu / utfc.sublime-snippet
Created October 1, 2014 15:28
Snippet for utf-8 python
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
<snippet>
<content><![CDATA[# coding=utf-8]]></content>
<tabTrigger>utfc</tabTrigger>
<scope>source.python</scope>
<description>coding: utf-8</description>
</snippet>
var Keen=Keen||{configure:function(e){this._cf=e},addEvent:function(e,t,n,i){this._eq=this._eq||[],this._eq.push([e,t,n,i])},setGlobalProperties:function(e){this._gp=e},onChartsReady:function(e){this._ocrq=this._ocrq||[],this._ocrq.push(e)}};(function(){var e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=("https:"==document.location.protocol?"https://":"http://")+"dc8na2hxrj29i.cloudfront.net/code/keen-2.1.0.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})();
Keen.configure({ // configure the Keen Client
projectId: projectId,
readKey: readKey
});
Keen.onChartsReady(function() {
var daysInChart = 30
@eevmanu
eevmanu / User.Preferences.sublime-settings
Created April 4, 2015 02:35
User preferences for sublime text 3
{
// Colors
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme",
"theme": "Soda Dark 3.sublime-theme",
// Font
"font_face": "Ubuntu Mono",
// "font_face": "Meslo LG L",
"font_options":
[
@eevmanu
eevmanu / project.sublime.project
Created April 4, 2015 02:37
Settings per project
{
"build_systems":
[
{
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"name": "Anaconda Python Builder",
"selector": "source.python",
"shell_cmd": "/home/xxxx/Envs/xxxxx/bin/python -u \"$file\"" //path python in virtualenv
}
],
@eevmanu
eevmanu / package_conf.txt
Created April 4, 2015 02:40
List of packages for my sublime text 3 set up
"Djaneiro"
"Anaconda"
"BracketHighlighter" top 25
"FileDiffs" top 100
"Git"
"GitGutter"
@eevmanu
eevmanu / middleware.py
Created April 12, 2015 20:17
Django profiler middleware with PEP8
import sys
import os
import re
import hotshot
import hotshot.stats
import tempfile
import StringIO
from django.conf import settings
@eevmanu
eevmanu / pretty_middleware.txt
Created April 12, 2015 21:16
Using silk as a profiler
1. install silk with all its requirements
pip install django-silk
simplejson
python-dateutil
Jinja2
pep8
autopep8
pytz
MarkupSafe
@eevmanu
eevmanu / prepare-commit-msg
Created October 26, 2015 22:20 — forked from jasonmerino/prepare-commit-msg
Prepend branch name to every git commit message unless on master.
#!/bin/sh
#
# Prepend the branch name to the commit message
#
# Add this file as [repo]/.git/hooks/prepare-commit-msg
#
# A couple notes:
# 1. The file must be executable (chmod +x prepare-commit-msg)
# 2. This works on a per-repo basis (unless you follow this guide https://coderwall.com/p/jp7d5q/create-a-global-git-commit-hook)
@eevmanu
eevmanu / post_syncdb-signals.diff
Created January 6, 2016 01:47
Two differentes post_syncdb signals after run "sentry upgrade" y two server with same conditions
-> First one (incorrect for my use)
Sending post_syncdb signal for sentry: ['UserReport', 'ReleaseFile', 'OrganizationMemberTeam', 'SavedSearch', 'OrganizationAccessRequest']
-> Second one (works great!)
Sending post_syncdb signal for sentry: ['UserOption', 'SearchDocument', 'GroupBookmark', 'FilterKey', 'Activity', 'AccessGroup', 'ApiKey', 'Release', 'Organization', 'PendingProjectMember', 'FilterValue', 'GroupMeta', 'AffectedUserByGroup', 'Option', 'TeamMember', 'MessageFilterValue', 'ProjectCountByMinute', 'EventMapping', 'Alert', 'Broadcast', 'TrackedUser', 'User', 'OrganizationAccessRequest', 'AuthIdentity', 'ProjectOptions', 'PendingTeamMember', 'HelpPage', 'UserReport', 'GroupAssignee', 'Rule', 'Project', 'GroupRuleStatus', 'GroupTagKey', 'ProjectDomain', 'Team', 'SearchToken', 'LostPasswordHash', 'ProjectMember', 'OrganizationMemberTeam', 'ProjectKey', 'View', 'ReleaseFile', 'AuthProvider', 'MessageCountByMinute', 'SavedSearch', 'GroupedMessage', 'MessageIndex', 'File', 'GroupSeen', 'GroupHash', 'Aler
@eevmanu
eevmanu / lxml.problem
Created February 3, 2016 03:49
Solution when cannot build lxml package for installation
This problems happens because there is no enough space to compile 'lxml' package,
because it needs 1gb of RAM, so we are going to create a swap area to skip this error and
fake like we have more RAM
First, be sure you're out of memory
dmesg | tail
And see if you have packages needed installed
dpkg --get-selections | grep -v deinstall > ~/packages
cat ~/packages | grep {each package}
- libxml2