Skip to content

Instantly share code, notes, and snippets.

View laprej's full-sized avatar

Justin M. LaPre laprej

View GitHub Profile
@nathan815
nathan815 / docker-compose.yml
Last active November 6, 2023 23:50
Updated docker-compose.yml for big-data-europe/docker-hadoop
version: "2.1"
services:
namenode:
build: ./namenode
container_name: namenode
volumes:
- hadoop_namenode:/hadoop/dfs/name
environment:
- CLUSTER_NAME=test
apt-get install python2.7-dev python2.7
apt-get build-dep gdb
apt-get source gdb
sed -i -E "s|python3|/usr/bin/python2.7|" debian/rules
dpkg-buildpackage -uc -us -j8
dpkg-install ../*.deb
@denis-bz
denis-bz / Nd-testfuncs-python.md
Last active November 7, 2024 11:10
N-dimensional test functions for optimization, in Python
@goyalankit
goyalankit / bash_to_zsh_history.rb
Last active October 28, 2023 05:07
Import bash history to zsh history.
#################################################################
# = This script transfers bash history to zsh history
# = Change bash and zsh history files, if you don't use defaults
#
# = Usage: ruby bash_to_zsh_history.rb
#
# = Author: Ankit Goyal
#################################################################
# change if you don't use default values
@shigh
shigh / Makefile
Last active March 31, 2022 15:30
Using MPI with Cython and C++. Specifically, using Cython to make Python wrappers for C++ code that uses MPI.
all:
python setup.py build_ext --inplace
clean:
rm -f pympi.cpp
rm -f pympi.so
rm -rf build
@engie
engie / shared_ptr_pooling.cpp
Created September 25, 2013 12:17
Notes on pooling shared ptr's
//Storing shared pointers in boost pool allocators
//tl;dr It just works (tm)
//
//* If a lot of smallish objects are being allocated & freed a pool allocator
//can speed things up by specialising in allocating exactly that size of
//object.
//
//* If pointer lifetimes need to be managed with reference counting,
//std::shared_ptr can wrap an object to provide safe reference counting.
//
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@progrium
progrium / gist:956006
Created May 4, 2011 20:50
Greenlet exception handling in gevent
import gevent
import gevent.pool
class GroupWithExceptionCatching(gevent.pool.Group):
def __init__(self, *args):
super(GroupWithExceptionCatching, self).__init__(*args)
self._error_handlers = {}
def _wrap_errors(self, func):
"""Wrap a callable for triggering error handlers
@badsyntax
badsyntax / build.sh
Created January 11, 2011 20:56
An example PHP & BASH Post-Receive github web hook to package projects
#! /usr/bin/env bash
#clone the repo
git clone -q "${1}" "clones/${2}"
cd "clones/${2}"
#update the submodules (how do we handle errors here?)
git submodule --quiet update --init --recursive