Skip to content

Instantly share code, notes, and snippets.

Christos Zisopoulos christos

Block or report user

Report or block christos

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ferblape
ferblape / geolocation.js
Created Jun 17, 2017
JQuery free IP geolocation
View geolocation.js
$(document).ready(function(){
$.getJSON("http://jsonip.com/?callback=?", function (ipData) {
$.getJSON("https://freegeoip.net/json/" + ipData.ip, function (geoData) {
console.log(geoData.city);
});
});
});
@fertapric
fertapric / ecs-run
Last active Dec 10, 2018
Script to run a Docker container with the same configuration as the ECS service: environment variables and Docker image. It uses ecs-env: https://gist.github.com/fertapric/4ae3a1209e7118c275821ce35512daec
View ecs-run
$ ecs-run
Run a Docker container with the same configuration as an ECS service.
It uses the same image and environment variables of the ECS task definition.
Supported AWS CLI environment variables:
- AWS_ACCESS_KEY_ID: AWS access key.
- AWS_SECRET_ACCESS_KEY: AWS secret key.
- AWS_SESSION_TOKEN: session token.
- AWS_DEFAULT_REGION: AWS region.
@fertapric
fertapric / ecs-env.sh
Last active Aug 28, 2019
Script to extract environment variables from a ECS service
View ecs-env.sh
#!/bin/sh
print_help() {
echo "Extract environment variables from an ECS service."
echo
echo "Usage: $0 [OPTIONS] SERVICE"
echo
echo "Options:"
echo " -h, --help Print usage"
}
@SamSaffron
SamSaffron / gist:2a1c96e37e022153d86d06f9d0a7bf26
Last active Dec 31, 2016
How to run Discourse tests really fast
View gist:2a1c96e37e022153d86d06f9d0a7bf26

Tips for optimizing performance of the Discourse gigantic test suite

Change memory allocator

default:            9:37
tcmalloc:           8:32
lockless:           8:19
jemalloc 3.6.0:     7:45
@fxn
fxn / problem-solving-games.md
Last active Feb 3, 2019
Problem-Solving Games
View problem-solving-games.md
@christos
christos / README.md
Created Nov 27, 2015 — forked from wvengen/README.md
Ruby memory analysis over time
View README.md

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 May 21, 2019
Ruby memory analysis over time
View README.md

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

View database.yml
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 Aug 28, 2019
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
View s3.sh
# 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
You can’t perform that action at this time.