Skip to content

Instantly share code, notes, and snippets.

View jsperezg's full-sized avatar

Juan Salvador Pérez García jsperezg

  • Freelance
  • Alicante - Spain
View GitHub Profile
@jsperezg
jsperezg / migration
Created November 8, 2021 14:31
network migration
jb.localhost
tn.localhost
sn.localhost
@jsperezg
jsperezg / entrypoint.sh
Created January 24, 2018 11:51
docker-compose entry point for Decidim projects
#!/bin/sh -x
# https://github.com/docker-library/ruby/issues/66
export BUNDLE_PATH=$GEM_HOME
export BUNDLE_BIN=$GEM_HOME/bin
export BUNDLE_APP_CONFIG=$GEM_HOME/config
export USER_UID=`stat -c %u /code/Gemfile`
export USER_GID=`stat -c %g /code/Gemfile`
#!/usr/bin/env bash
USER=`whoami`
echo Updating installed software
sudo apt-get update >> ~/install.log
sudo apt-get -y -u upgrade >> ~/install.log
echo Installing MySQL
echo 'mysql-server mysql-server/root_password password d3m0pr0j3ct' | sudo debconf-set-selections
@jsperezg
jsperezg / fixnum_serialization.rb
Created April 20, 2017 07:52
Serializes numbers with more than 53 bit as strings.
class Fixnum
alias_method :default_as_json, :as_json
# Serializes long integers as strings.
def as_json(options = {})
if self.bit_length > 53
"#{ default_as_json(options) }"
else
default_as_json(options)
end