Skip to content

Instantly share code, notes, and snippets.

View nebulou5's full-sized avatar

Richard Harrington nebulou5

View GitHub Profile
@nebulou5
nebulou5 / flatten.py
Last active September 26, 2023 17:41
original_list = [[1, 2, 3], [4, 5], [6, 7, 8, 9]]
flattened_list = [element for sublist in original_list for element in sublist]
static ConstructorHelpers::FObjectFinder<UMaterial> MaterialFinder(*SelectionMaterialPath);
if (MaterialFinder.Succeeded()) {
SelectionDecalMaterial = MaterialFinder.Object;
SelectionDecalMaterialInstance = UMaterialInstanceDynamic::Create(SelectionDecalMaterial, this);
SelectionDecal = CreateDefaultSubobject<UDecalComponent>(TEXT("SelectionDecal"));
SelectionDecal->AttachTo(RootComponent);
SelectionDecal->SetDecalMaterial(SelectionDecalMaterialInstance);
}
@nebulou5
nebulou5 / gist:59a6e73aac534517c425ddb18aa09b68
Created April 10, 2016 12:57
VIM: Remap range of numbers
for i in range(9)
execute 'nmap <leader>' . i . ' ' . i . 'gt'
endfor
it('returns OPTIONS response if origin header is capitalized', (done) => {
const handler = function (request, reply) {
return reply(Boom.badRequest());
};
const server = new Hapi.Server();
server.connection({ routes: { cors: true } });
server.route({ method: 'GET', path: '/', handler: handler });