Skip to content

Instantly share code, notes, and snippets.

View mayeco's full-sized avatar

Mario Young mayeco

  • Sevilla, Spain
View GitHub Profile
@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active March 1, 2026 09:05
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
@ibrahimlawal
ibrahimlawal / LC_CTYPE.txt
Created February 27, 2017 07:02 — forked from jampajeen/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@radiovisual
radiovisual / .eslintrc
Last active September 18, 2025 07:55
React Native AirBnB ESLint Config
{
"parser": "babel-eslint",
"plugins": [
"react",
"react-native"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"modules": true
@parmentf
parmentf / GitCommitEmoji.md
Last active March 16, 2026 01:28
Git Commit message Emoji
@brock
brock / psql-with-gzip-cheatsheet.sh
Last active May 14, 2025 13:12
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
@sroze
sroze / MyCommand.php
Last active June 6, 2021 13:58
Symfony Command that read file from file name or STDIN
<?php
namespace AmceBundle\Command;
class MyCommand
{
// ...
protected function execute(InputInterface $input, OutputInterface $output)
{
@chrisguitarguy
chrisguitarguy / form.html.twig
Last active February 10, 2017 15:33
How to use Bootstrap input groups (http://getbootstrap.com/components/#input-groups) in a Symfony form theme
{% form_theme form 'theme.html.twig' %}
{# the theme above will take care of rendering the input group #}
{{ form(form) }}
@fatrex
fatrex / gulpfile.js
Last active February 25, 2017 10:56
Gulp for Symfony 2
var gulp = require('gulp');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var shell = require('gulp-shell');
gulp.task('serve', ['dump'], function() {
browserSync({
proxy: "local.symfony.domain/app_dev.php"
});
@jfcote87
jfcote87 / gist:3c4550e4dedb563e9f9a
Created February 3, 2015 18:05
Example of oauth2 bug: RefreshToken not updated in TokenSource
package main
import (
"encoding/json"
"fmt"
"golang.org/x/oauth2"
"log"
"net/http"
"net/http/httptest"
"time"
package oauth2Sample
imports (
"fmt"
"log"
"net/http"
"golang.org/x/oauth2"
)