Skip to content

Instantly share code, notes, and snippets.

@christos
christos / etc-init-d-monit
Created November 10, 2010 14:29
EC2 config files
#! /bin/sh
#
# skeleton example file to build /etc/init.d/ scripts.
# This file should be used to construct scripts for /etc/init.d.
#
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified for Debian
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#
# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl
@hramos
hramos / upload-testflight.sh
Created January 11, 2011 03:51
Deploy builds to Testflight with this script. Use a git wrapper (i.e. git push-and-deploy) to invoke git push, then xcodebuild, then this script.
#!/bin/sh
FILE=@FILENAME.ipa
API_TOKEN='<api key under account>'
TEAM_TOKEN='<team token under specific team>'
NOTES='Buildscript'
ENDPOINT=http://testflightapp.com/api/builds.json
DISTRIBUTION_LISTS='Internal'
curl $ENDPOINT -F file=$FILE -F api_token=$API_TOKEN -F team_token=$TEAM_TOKEN -F notify=true -F distribution_lists=$DISTRIBUTION_LISTS -F notes=$NOTES
#!/bin/bash
# To run do: curl https://theurl.com/bootstrap.sh | bash && source ~/.profile
#
# Based on Amazon EC2 AMI ID ami-ccf405a5 Ubuntu Server 10.10
# This script must install the following requirements
# * apache2
# * mod_wsgi
# * mysql
# * pip
from hashlib import sha1
def main():
print hashfile("~/Desktop/lift-columns.png")
def hashfile(path):
f = open(path)
file_hash = githash(f.read())
f.close()
@leah
leah / json-response.py
Created October 5, 2011 19:08
JSONResponse classes
import re
import simplejson
from django.http import HttpResponse
from django.conf import settings
class JSONResponse(HttpResponse):
def __init__(self, request, data):
indent = 2 if settings.DEBUG else None
- Descripción y alcance del proyecto
- Cual fue el análisis para determinar que el problema era viable. Estudio de viabilidad.
- Por que se recomienda esa solución
- Determinar costo
- Plan de proyecto
- Gantt chart
- Modelos para la fase de Análisis
- Diagramas de diseño
@jsocol
jsocol / Explain.rst
Last active September 28, 2015 07:27
@json_view decorator

I finally put this in its own package! Check out django-jsonview.

This is a decorator that guarantees a response will be JSON, and sends meaningful (to a developer) error messages. It relies on a BadRequest exception I created elsewhere, because there is no standard way of handling that in Django (frex, we should really return HTTP 400 on form validation failures but they don't make that particularly easy). That could easily be removed, though.

@divad12
divad12 / log_handler.py
Created October 13, 2012 07:26
Django log handler for sending messages to HipChat
"""Custom log handler for posting log messages to HipChat.
Adapted from https://gist.github.com/3176710
The API documentation is available at
https://www.hipchat.com/docs/api/method/rooms/message
The room id can be found by going to
https://{{your-account}}.hipchat.com/rooms/ids
@dadon
dadon / handlebars_translate.js
Created December 7, 2011 13:41
Django gettext in Handlebars.js templates
Handlebars.registerHelper('trans', function(fn) {
return gettext(fn(this));
});
@pixelhandler
pixelhandler / ember-cli-upgrade-1.13.8-to-1.13.13.sh
Last active December 6, 2015 22:49
Bash script to update dependencies (based on release notes) for an ember-cli app or addon, v1.13.8 -> v1.13.13
#!/usr/bin/env bash
# Use with arg $1 as --app or --addon and optional arg $2 as --backup to keep a copy of the original files
#
# Upgrade Ember-CLI dependencies from 1.13.8 to 1.13.13
#
# - https://github.com/twokul/ember-cli-release-notes/commit/1cee41eb91bf7c534917fdd4cd42a1cd1a481c75
# - https://github.com/ember-cli/ember-cli/releases/tag/v1.13.12
# - https://github.com/ember-cli/ember-cli/releases/tag/v1.13.13