Think In Geek

In geek we trust

Uncategorized

Setting and deleting cookies in Go

In this post we’ll learn how to set and delete cookies as part of your Go HTTP Handlers. We’ll also learn one way to test our handlers using HTTP recorders.

,

Redirect parts of your website to different applications with Apache

Microservices everywhere. Those are the times we live in now. Everyone seems to be splitting monolithic web applications into smaller chunks. And that’s fine. However, setting up the local development environment for this can be sometimes a bit cumbersome.

,

A very simple memory pool in C++11

I’ve been implementing an algorithm that works on a graph. That algorithm needs to create and destroy lots of nodes and edges to keep track of the algorithm state correctly. The algorithm also needs to be fast in order to be competitive against a similar algorithm that uses sets of stacks instead of graphs. Profiles […]

10 years of Think In Geek

10 years ago Bernat (brafales) started this blog. This is still his blog though he is a bit busy these days and he cannot publish as much as he wants. All in all, without his initiative this blog would not exist. As would not exist many of the posts I published here since 2012, when […]

A small Telegram Bot in Go

I started using Telegram a few years ago. Most of the time I don’t use it much to have 1 to 1 conversations but rather chat in a small group of friends which I’ve known for a while now. Every now and then, we share some links to Twitter on that group, and unfortunately the […]

When an array is not an array

The C programming language comes with its own set of warts if we closely examine its syntax and semantics. One of the oddities that puzzles most people is the fact that there are no parameters of array types in C. This fact, though, does not prevent one using the array syntax in a parameter.

, , , ,

TinyMCE checkbox toggler for jQuery

Here’s a small jQuery code snippet that you can use to have an easy to use checkbox toggler to enable or disable a TinyMCE editor with ease (tested on TinyMCE version 4 and jQuery version 2.1.1). It’s really easy to use. You just need to create a checkbox element with the class tiny_mce_toggler and a […]

, ,

How to create and configure EC2 instances for Rails hosting with CentOS using Ansible

Introduction In this quite extensive post I will walk you through the process of creating from scratch a box in EC2 ready to use for deploying your Rails app using Ansible. In the process I will show how to write a simple module that, while not necessary, will illustrate some points as well. Keep in […]

, , , , , , , , , , ,

Check progress of a mysql database import

If you’ve ever had to do a huge mysql import, you’ll probably understand the pain of not being able to know how long it will take to complete. At work we use the backup gem to store daily snapshots of our databases, the main one being several gigabytes in size. This gem basically does a […]

, ,

Create a temporary zip file to send as response in Rails

We have been doing a painful migration from Rails 2 to Rails 3 for several months at work, and refactoring some code the other day I had to do something in a non straightforward way, so I thought I’d share that. Basically we had an action that would group several files into a zip file […]

, ,

Previous Posts