Skip to content

Instantly share code, notes, and snippets.

View doismellburning's full-sized avatar
🔥

Kristian Glass doismellburning

🔥
View GitHub Profile
@doismellburning
doismellburning / elasticsearch.pp
Created February 12, 2015 12:30
Example Elasticsearch puppet config with instancing
class myexample::elasticsearch (
) {
$instance = 'loremipsum'
class {
'::elasticsearch':
package_url => 'https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.2.1.deb',
}
node base {
$domain = "llama.example.com"
include webserver # uses $domain internally
}
node custom inherits base {
$domain = "badger.example.com"
}
# The $domain variable is evaluated in the base scope, so the "override" that is being attempted in the `custom` doesn't work.

On Meetings

  • Have an agenda.
    • If there is no agenda, it is not a meeting, it is a chat ;)
    • If the agenda was not published sufficiently in advance, are people going to be able to contribute effectively?
  • Publish minutes
    • Useful record, useful for ensuring everyone agrees about what was concluded!
    • If it wasn't worth writing up, was it that important? ;)
    • Verbatim transcripts are not minutes - minutes "are" action points and brief summaries of discussions and decisions
  • Could you replace this meeting with an item in your issue tracker?
class UserProfileView(DetailView):
def get_object(self):
return self.request.user
def get_context_data(self, **kwargs):
context = super(UserProfileView, self).get_context_data(**kwargs)
context['post_count'] = self.request.user.posts.objects.all().count()
char * string_space;
char * top_string;
char str_empty [1];
/*
* Duplicate a string into dynamic memory.
* Fread_strings are read-only and shared.
*/
char *str_dup( const char *str ) {
char *str_new;

I have a MUD codebase from pre-1997. It is 80k lines of C, 4k lines of code, 100 lines of lex. It dates back to the days when "malloc was slow" so you did your own memory management. It maintains its own free pools. These are important, because lots of code assumes it can use an object after it's "freed", and most of the time this is just about ok. It has its own list types (types plural; multiple types, subtly different in their own ways).

It also has 4000 lines of C++ because of a venture made into maybe adding these newfangled object things, using some standard list types, etc.

I am interested in continuing this codebase. I would like to use a language that offers a little more..."safety" and with more "stdlibness".

I do not want to do a complete rewrite; continual improvement is really the only viable path.

I want a language that has pleasant C integration (because there's 80k lines of it) and that has decent expressive "static-y" typing (so no Python/Ruby) for build time checks and easy refactoring (

#!/bin/bash -x
# Very very hacky, I'm so sorry
TYPE=$1
PROCFILE="./Procfile"
# TODO More getopts
if [ -z $TYPE ]

WSGI is a protocol/interface, that (roughly) describes translation between HTTP requests/responses and Python

This is similar to Java's Servlet specification, or the CGI spec.

uWSGI is a webserver that implements 'the server side of' WSGI, i.e. it takes HTTP requests and turns them into Python request objects, passes them off to whatever code you're running with it, gets a Python response object back, and returns it as an HTTP response.

Do not confuse uWSGI with WSGI. Other WSGI webservers exist, e.g. gunicorn, or apache+mod_wsgi.

from django.apps import apps
from django.template import Library
register = Library()
_static = None
@register.simple_tag
def static(path):

Antelope v2 depends on Badger>1,<4 Badger has v1,v2,v3,v4 and no dependencies

If you have nothing installed:

  • pip install Antelope==2 will leave you with Antelope v2, Badger v3
  • pip install --upgrade Antelope==2 will exhibit the same behaviour

If you have Badger v1 installed: