Skip to content

Instantly share code, notes, and snippets.

View jeffmarshall's full-sized avatar

Jeff Marshall jeffmarshall

View GitHub Profile
Environment:
Request Method: GET
Request URL: http://jmarshall-devbox.local:8000/
Django Version: 1.2.1
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
var datatypes = {
action: /^[-\w]$/,
channel: /^[-_a-z0-9]*$/,
nick: /^[-\w]$/,
message: /^.{1,255}$/,
timestamp: /^\d$/
}
var messagetype = {
info it worked if it ends with ok
verbose cli [ 'node',
verbose cli '/usr/local/bin/npm',
verbose cli 'install',
verbose cli 'express',
verbose cli 'stylus',
verbose cli 'jade' ]
info using npm@1.0.1rc9
info using node@v0.5.0-pre
verbose config file /Users/jeff/.npmrc
/**
* Module dependencies.
*/
var express = require('express');
var classily = require('./classily').classily;
var app = module.exports = express.createServer();
@jeffmarshall
jeffmarshall / redditpodcast.css
Created September 3, 2011 01:59
/r/redditpodcast
html {
height:100%;
}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td,iframe {
margin:0;
padding:0;
}
table { border-collapse:collapse; }
fieldset,img { border:0; }
address,caption,cite,code,dfn,em,strong,th,var { font-style:normal; font-weight:normal; }
#!/bin/bash
set -e
LOGFILE=/var/log/gunicorn/lex.log
NUM_WORKERS=3
# user/group to run as
USER=lex
GROUP=lex
cd /srv/lex/site/lex
source ../../env/bin/activate
exec /srv/lex/site/lex/manage.py run_gunicorn -w $NUM_WORKERS \
@jeffmarshall
jeffmarshall / es.sh
Last active December 14, 2015 01:39 — forked from sgringwe/es.sh
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
# Download the compiled elasticsearch rather than the source.
wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.5.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
sudo mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
from django.contrib import admin
from hvad.admin import TranslatableStackedInline, TranslatableAdmin
from generic.models import Text, Page
class TextInline(TranslatableStackedInline):
model = Text
extra = 1
from django.db import models
from django.utils.translation import ugettext_lazy as _
from hvad.models import TranslatableModel, TranslatedFields
class Page(models.Model):
slug = models.SlugField()
class Meta:
@jeffmarshall
jeffmarshall / gist:5067229
Last active December 14, 2015 09:49 — forked from dianaj/gist:5067043
public class cosine2 {
public static void main(String [] args) {
double x = Double.parseDouble(args [0]);
x = Math.toRadians (x);
System.out.println (x);
for (int i=0; i<8; i=i+1) {
int n = 2*i;
double p = Math.pow(x,n);