Skip to content

Instantly share code, notes, and snippets.

View johnt1000's full-sized avatar
🐞
if without condition

Jônatas Rodrigues johnt1000

🐞
if without condition
View GitHub Profile
@johnt1000
johnt1000 / install_psql_php.sh
Last active September 12, 2015 02:10 — forked from giorgiofellipe/install_psql_php.sh
Install PHP PGSQL extensions on Mac OS X Yosemite (change PHP_VER with your PHP version)
PHP_VER="5.5.14"
# Check if extension exists first
php -m | grep pgsql
# Update brew and install requirements
brew update
brew install autoconf
# Download PHP source and extract
#!/usr/bin/env bash
sudo sh -c "echo 'export LANGUAGE=en_US.UTF-8' >> /etc/bash.bashrc"
sudo sh -c "echo 'export LANG=en_US.UTF-8' >> /etc/bash.bashrc"
sudo sh -c "echo 'export LC_ALL=en_US.UTF-8' >> /etc/bash.bashrc"
sudo sh -c "echo 'LC_ALL=en_US.UTF-8' > /etc/default/locale"
sudo sh -c "echo 'LANG=en_US.UTF-8' >> /etc/default/locale"
sudo locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales
#sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
@johnt1000
johnt1000 / solutions.markdown
Created November 5, 2015 17:50 — forked from bvajda/solutions.markdown
ruby/rails tips, tricks, solutions

Ruby and Rails Tips, Tricks and Solutions

  • 'normalize_yaml_input' error might be caused by wrong locale settings.

    # CLI
    locale
    # => "LC_ALL ="
    export LC_ALL="en_US" # (or your locale of choice)
    
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get install -y wget unzip
cd /vagrant && wget https://dl.dropboxusercontent.com/u/25746552/scripts/instant_client_oracle/32/instantclient-basiclite-linux-12.1.0.2.0.zip
cd /vagrant && wget https://dl.dropboxusercontent.com/u/25746552/scripts/instant_client_oracle/32/instantclient-sdk-linux-12.1.0.2.0.zip
cd /vagrant && wget https://dl.dropboxusercontent.com/u/25746552/scripts/instant_client_oracle/32/instantclient-sqlplus-linux-12.1.0.2.0.zip
sudo mkdir /opt
sudo mkdir /opt/oracle
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@johnt1000
johnt1000 / inflections.rb
Created February 12, 2016 16:22 — forked from mateusg/inflections.rb
pt-BR inflections file for Ruby on Rails applications
# encoding: utf-8
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
wildcard ?
# -----------------------------------------------------------
# some signatures that may be helpful
# -----------------------------------------------------------
gpg y 2500000 \x8c\x0d\x04\x03\x03\x02
png y 2500000 \x89\x50\x4e\x47\x0d\x0a\x1a\x0a \x49\x45\x4e\x44
kdb y 2500000 \x03\xd9\xa2\x9a\x65\xfb\x4b\xb5
kdbx y 2500000 \x03\xd9\xa2\x9a\x66\xfb\x4b\xb5
This might work for you:
# mkdir temp && cd temp && touch file.{a..e}
# ls
file.a file.b file.c file.d file.e
# md5sum * | sed -e 's/\([^ ]*\) \(.*\(\..*\)\)$/mv -v \2 \1\3/' | sh
`file.a' -> `d41d8cd98f00b204e9800998ecf8427e.a'
`file.b' -> `d41d8cd98f00b204e9800998ecf8427e.b'
`file.c' -> `d41d8cd98f00b204e9800998ecf8427e.c'
`file.d' -> `d41d8cd98f00b204e9800998ecf8427e.d'