Skip to content

Instantly share code, notes, and snippets.

View guilhermewop's full-sized avatar
😎
Coders gonna code

Guilherme Pereira guilhermewop

😎
Coders gonna code
View GitHub Profile
@MarkBennett
MarkBennett / installing-ruby-2.5.1-on-m1.md
Last active March 23, 2024 10:21
Installing Ruby 2.5 on Mac M1
@kentblake
kentblake / update-alternatives-python.sn
Last active June 20, 2020 10:03
Update alternatives syntax for changing from python2.7 to python3.7
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 2
@cdesch
cdesch / rails_generator_cheat_sheet.md
Last active March 30, 2024 09:07
Rails Generator CheatSheet

Cheat Sheets are greate but they are not a substitute for learning the framework and reading the documentation as we most certainly have not covered every potential example here. Please refer to the Rails Command Line Docs for more information.

Command Line Generator Info

Reference

You can get all of this information on the command line.

rails generate with no generator name will output a list of all available generators and some information about global options. rails generate GENERATOR --help will list the options that can be passed to the specified generator.

@nerf
nerf / god.service
Created January 17, 2017 12:39
Systemd configuration for ruby God supervisor
[Unit]
Description=God: A process monitoring framework in Ruby
After=network.target
[Service]
Group=_USER_GROUP_
User=_USER_
ExecStart=/usr/local/sbin/god_startup start
ExecStop=/usr/local/sbin/god_startup stop
@dgoguerra
dgoguerra / git-prune.md
Created September 8, 2016 13:59
Prune branches and tags deleted in the remote
# prune branches deleted in origin
git remote prune origin

# prune tags
# http://stackoverflow.com/questions/1841341/remove-local-tags-that-are-no-longer-on-the-remote-repository
git fetch --prune <remote> '+refs/tags/*:refs/tags/*'
@ndelitski
ndelitski / redis-no-persistence.conf
Created July 20, 2016 09:10
redis without persistence config
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
# 1gb => 1024*1024*1024 bytes
#
@equivalent
equivalent / gist:b492f6779e99ee9defb2
Created March 23, 2016 23:54
Ruby AES Encryption using OpenSSL
#!/usr/bin/env ruby
require "openssl"
require 'digest/sha2'
require 'base64'
# We use the AES 256 bit cipher-block chaining symetric encryption
alg = "AES-256-CBC"
# We want a 256 bit key symetric key based on some passphrase
digest = Digest::SHA256.new
@sumitdhameja
sumitdhameja / Heirloom_MailX.sh
Created February 27, 2016 17:53
Setting up Heirloom MailX to send emails from linux(Debian/ ubuntu) system:
mkdir MailX
cd MailX
#Download file
wget http://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5.orig.tar.gz
#Download patch
wget http://www.linuxfromscratch.org/patches/blfs/svn/heirloom-mailx-12.5-fixes-1.patch
#unZip
tar -xvzf heirloom-mailx_12.5.orig.tar.gz
@m1st0
m1st0 / php_build_ubuntu.sh
Last active November 25, 2023 07:33
Compiling PHP 8 on Ubuntu 22.10 with Various Supported Modules
#!/bin/bash
# PHP 8 Compile #
# Author: Maulik Mistry
# Please share support: https://www.paypal.com/paypalme/m1st0
# References:
# http://www.zimuel.it/install-php-7/
# http://www.hashbangcode.com/blog/compiling-and-installing-php7-ubuntu
# root-talis https://gist.github.com/root-talis/40c4936bf0287237839ccd3fdfdaec28
#
@max
max / mailer.rb
Last active March 23, 2020 16:44
A simple Ruby script to send mass emails
require 'mail'
require 'csv'
FILE = ARGV[0]
Mail.defaults do
delivery_method :smtp, {
address: '',
port: 587,
domain: '',
user_name: '',