Skip to content

Instantly share code, notes, and snippets.

View christos's full-sized avatar

Christos Zisopoulos christos

View GitHub Profile
@fxn
fxn / problem-solving-games.md
Last active June 11, 2023 17:21
Problem-Solving Games
@christos
christos / README.md
Created November 27, 2015 15:04 — forked from wvengen/README.md
Ruby memory analysis over time

Finding a Ruby memory leak using a time analysis

When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.

There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the

@wvengen
wvengen / README.md
Last active March 25, 2024 07:53
Ruby memory analysis over time

Finding a Ruby memory leak using a time analysis

When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.

There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the

default: &default
adapter: mysql2
encoding: utf8mb4
username: root
password:
host: localhost
variables:
sql_mode: TRADITIONAL,NO_AUTO_VALUE_ON_ZERO,ONLY_FULL_GROUP_BY
development:
@chrismdp
chrismdp / s3.sh
Last active March 5, 2024 12:57
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@fxn
fxn / irpf.rb
Last active January 13, 2021 08:04
IRPF 2014
# Usage:
#
# ruby irpf.rb tax_base
#
# Example:
#
# ruby irpf.rb 65300
# 65300 €, 22722 €, 34.8%
#
# Where 22,722 € is the IRPF to pay, and 34.8% is the real rate, that is,
@bomberstudios
bomberstudios / top_100_anime_movies.md
Last active December 25, 2021 18:09
Top 100 Anime Movies Of All Time (from http://imgur.com/a/k2vwE)
  1. Colorful (2010) [T]

    Probably not the title that most people expected to see in the #1 slot. I urge everyone to give it a shot though. No other film has ever brought me through a greater spectrum of emotions. It's a supernatural film, but the characters are so well fleshed out and developed that they feel real. I've probably seen a hundred films since, but none have compared.

  2. Time of Eve (2010) [T]

Director: Yasuhiro Yoshiura - "Sometime in future Japan, androids have been involved in every aspect of peoples lives. One day, upon checking his android's behavioral log, Rikuo, a student, noticed his android's returning times have been odd recently. With his friend Masaki, they found out the place where his android, Sammy, have been visiting: a small cafe called Eve no Jikan where an

@masciugo
masciugo / multi-database_pattern.md
Created September 26, 2014 16:54
Rails multi-database pattern

Rails multi-database pattern

The parent class for models that are persisted on a different database app/models/public_database_model.rb:

# Public: Provide a base class for accessing the public database.
# All models inheriting from this class will use by default the data store DB.
class PublicDatabaseModel < ActiveRecord::Base

Tell Active Record (AR) to not look up for a table called like this class,

@JunichiIto
JunichiIto / alias_matchers.md
Last active April 16, 2024 16:18
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
@calavera
calavera / setup.sh
Last active September 4, 2016 08:16
From 0 to OMG my new laptop is almost ready for some coding!
#! /bin/sh
# Enable FileVault
if [[ `fdesetup status` != "FileVault is On." ]]; then
sudo fdesetup enable
fi
xcode-select --install
echo "###############################################################"