Skip to content

Instantly share code, notes, and snippets.

View pandabamboo90's full-sized avatar

Dang Nguyen pandabamboo90

View GitHub Profile
@pandabamboo90
pandabamboo90 / remove-merged-branch-remote.sh
Last active January 27, 2024 17:36 — forked from schacon/gist:942899
delete all remote branches that have already been merged into master & develop
git fetch --prune
for branch in $(git branch -r --merged master | grep origin | grep -v develop | grep -v master)
do
MARK_FOR_DELETE_BRANCHES+=" ${branch#*/}"
done
# echo $MARK_FOR_DELETE_BRANCHES
# Delete the branches
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@pandabamboo90
pandabamboo90 / git_delete_merged_branches.md
Created July 30, 2018 07:14
git command to delete merged branches

git branch --merged | grep -v "*" | grep -v "master" | xargs git branch -d

@pandabamboo90
pandabamboo90 / install_mysql2_gem_with_xampp.md
Last active December 23, 2023 05:59
Install mysql2 gem with XAMPP

gem install mysql2 -v '0.4.9' -- --with-mysql-config=/Applications/XAMPP/xamppfiles/bin/mysql_config --with-mysql-include=/Applications/XAMPP/xamppfiles/include

For Homebrew

gem install mysql2 -v '0.5.3' -- --with-mysql-lib=/opt/homebrew/opt/mysql-client/lib --with-mysql-include=/opt/homebrew/opt/mysql-client/include

@pandabamboo90
pandabamboo90 / .rubocop.yml
Created August 13, 2017 11:54 — forked from jhass/.rubocop.yml
My preferred Rubocop config
AllCops:
RunRailsCops: true
# Commonly used screens these days easily fit more than 80 characters.
Metrics/LineLength:
Max: 120
# Too short methods lead to extraction of single-use methods, which can make
# the code easier to read (by naming things), but can also clutter the class
Metrics/MethodLength:
@pandabamboo90
pandabamboo90 / installation.sh
Created February 26, 2017 09:28 — forked from mikhailov/installation.sh
nginx+passenger (real production config)
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776
$ cd /usr/src
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz
@pandabamboo90
pandabamboo90 / gist:99908f36feaf63e76fc6
Created March 24, 2016 02:10 — forked from trcarden/gist:3295935
Rails 3.2.7 SSL Localhost (no red warnings, no apache config)
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key