Skip to content

Instantly share code, notes, and snippets.

View matagus's full-sized avatar
🐿️

Matías Agustín Méndez matagus

🐿️
View GitHub Profile
@anotherjesse
anotherjesse / gist:70718
Created February 26, 2009 07:07
Chart application health from New Relic in Munin
#!/usr/bin/env ruby
require 'open-uri'
require 'rexml/document'
require 'rexml/xpath'
url = 'http://rpm.newrelic.com/accounts.xml?include=application_health'
headers = {'x-license-key' => 'YOUR LICENSE KEY'}
@zacharyvoase
zacharyvoase / pipes.py
Created May 28, 2009 23:42
pipes.py - Command-piping syntax for generators/coroutines in Python.
# -*- coding: utf-8 -*-
# pipes.py - Command-piping syntax for generators/coroutines in Python.
"""
pipes.py - Command-piping syntax for generators/coroutines in Python.
Example:
>>> from pipes import *
>>> chain1 = counter(5) | adder(2)
@gvangool
gvangool / daemonextension.py
Created July 13, 2009 13:51 — forked from screeley/daemonextension.py
Django Management Command for starting a daemon.
"""
Copyright (c) 2009, Sean Creeley
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
@danmackinlay
danmackinlay / supervisord.sh
Created August 27, 2009 07:07
an init.d script for supervisord
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
import django
from django.utils.translation import ugettext_lazy as _
from debug_toolbar.panels import DebugPanel
from haystack.backends import queries
class HaystackDebugPanel(DebugPanel):
"""
Panel that displays the Haystack queries.
"""
name = 'Haystack'
# How to echobot with XMPP, BOSH, and Strophe
1. Setup ejabberd(http://www.ejabberd.im/) server and setup account [email protected]
NOTE: localhost should be enough. If you setup something else, make sure you add it at /etc/hosts like this
#/etc/hosts
127.0.0.1 localhost.local
NOTE: Also download Psi(http://psi-im.org/), and make sure you can connect to your ejabberd server.
2. Download strophe(http://code.stanziq.com/strophe/) and place it (eg: /Users/makoto/work/sample/strophejs-1.0)
@onyxfish
onyxfish / fabfile.py
Created February 9, 2010 23:05
Chicago Tribune News Applications fabric deployment script
from fabric.api import *
"""
Base configuration
"""
env.project_name = '$(project)'
env.database_password = '$(db_password)'
env.site_media_prefix = "site_media"
env.admin_media_prefix = "admin_media"
env.newsapps_media_prefix = "na_media"
var daemon = require('./daemon');
var sys = require('sys');
var fs = require('fs');
var http = require('http');
var config = {
lockFile: '/tmp/hellohttpd.lock' //Location of lockFile
};
var args = process.argv;
@vicalejuri
vicalejuri / django-crossdomainxhr-middleware.py
Created June 5, 2010 17:47
Middlware to allow's your django server to respond appropriately to cross domain XHR (postMessage html5 API).
import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
from django import http
try:
import settings
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active November 2, 2024 12:56
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh