Skip to content

Instantly share code, notes, and snippets.

🐧
Linux forever

Maurizio De Santis mdesantis

🐧
Linux forever
Block or report user

Report or block mdesantis

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
View details-demo.md
app/controllers/controlla_il_controller.rb
class ControllaIlController
end
@mdesantis
mdesantis / guix-install.sh
Last active Sep 26, 2018
GNU Guix v0.15.0 installer, non interactive version (suitable for Docker; modified from https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh?h=v0.15.0)
View guix-install.sh
#!/bin/bash
# GNU Guix --- Functional package management for GNU
# Copyright © 2017 sharlatan <sharlatanus@gmail.com>
# Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
# Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
#
# This file is part of GNU Guix.
#
# GNU Guix is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
View tsung.xml
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd" [] >
<tsung loglevel="info">
<clients>
<client host="localhost" use_controller_vm="true" maxusers="60000"/>
</clients>
<servers>
<server host="localhost" port="3334" type="tcp"></server>
</servers>
@mdesantis
mdesantis / sir-trevor.coffee.erb
Created Dec 21, 2017
Sir Trevor initializer for Rails
View sir-trevor.coffee.erb
$(document).on 'ready turbolinks:load', ->
SirTrevor.config.language = 'it'
SirTrevor.setDefaults(
language: 'it'
focusOnInit: false
blockTypes: ['Text', 'Image', 'List', 'Heading', 'Quote', 'Video']
defaultType: 'Text'
iconUrl: "<%= asset_path('sir-trevor/build/sir-trevor-icons.svg') %>"
uploadUrl: "/admin/uploads/images"
@mdesantis
mdesantis / upgrade-postgres-9.6-to-10.md
Last active Jul 24, 2019 — forked from delameko/upgrade-postgres-9.5-to-9.6.md
Upgrading PostgreSQL from 9.6 to 10 on Ubuntu 16.04
View upgrade-postgres-9.6-to-10.md

TL;DR

Install Postgres 10, and then:

sudo pg_dropcluster 10 main --stop
sudo pg_upgradecluster 9.6 main
sudo pg_dropcluster 9.6 main
View asd.rb
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
# Activate the gem you are reporting the issue against.
View gist:214982b377e94020980347eaf21b8efc
> rails -v
Rails 5.1.0.rc1
> rails new rails_vue --webpack=vue
create
create README.md
create Rakefile
create config.ru
create .gitignore
create Gemfile
run git init from "."
@mdesantis
mdesantis / unique_constraint_handler.rb
Last active Aug 29, 2015
PostgreSQL unique constraint handler: it sets the record as invalid if a PostgreSQL unique constraint error is raised on record saving
View unique_constraint_handler.rb
# Usage example:
#
# class User < ActiveRecord::Base
# include UniqueConstraintHandler
# handle_unique_constraint_on :email
# end
#
# User.create email: 'test@example.com'
# user = User.create email: 'test@example.com'
# user.new_record? #=> true
View keybase.md

Keybase proof

I hereby claim:

  • I am mdesantis on github.
  • I am mdesantis (https://keybase.io/mdesantis) on keybase.
  • I have a public key whose fingerprint is F5F7 7045 0619 72C4 1130 5FD1 477C 5D30 1F85 13A9

To claim this, I am signing this object:

@mdesantis
mdesantis / heroku-bypass-5000.sh
Created Sep 5, 2014
Bypass Heroku connection on 5000 port (useful for troubled networks, such as italian ISP Fastweb)
View heroku-bypass-5000.sh
#!/bin/bash
echo 127.0.0.1 rendezvous-eu-west-1-a.runtime.heroku.com >> /etc/hosts
ssh -L 5000:rendezvous-eu-west-1-a.runtime.heroku.com:5000 remoteuser@remoteserver
You can’t perform that action at this time.