Skip to content

Instantly share code, notes, and snippets.

View arbaouimehdi's full-sized avatar
🎯
focusing

Arbaoui Mehdi arbaouimehdi

🎯
focusing
View GitHub Profile
@arbaouimehdi
arbaouimehdi / backup-github.sh
Created November 4, 2017 14:30 — forked from rodw/backup-github.sh
A simple script to backup an organization's GitHub repositories, wikis and issues.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
# NOTE: if you have more than 100 repositories, you'll need to step thru the list of repos
# returned by GitHub one page at a time, as described at https://gist.github.com/darktim/5582423
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up
# (if you're backing up a user's repos instead, this should be your GitHub username)
GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API)
@arbaouimehdi
arbaouimehdi / wordpress.nginx
Created October 27, 2017 11:13 — forked from LeCoupa/wordpress.nginx
WordPress - Nginx Configuration File (with SSL)
##
# @server studio
# @host hackisition.com
# @desc nginx host rules
# @author Julien Le Coupanec <[email protected]>
##
# HTTP Server
server {
listen 80;
@arbaouimehdi
arbaouimehdi / Gemfile
Last active October 18, 2017 18:34
Gemfile
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# Rails
gem 'rails', '~> 5.1.3'
### Rails template
*.rbc
capybara-*.html
.rspec
/log
/tmp
/db/*.sqlite3
/db/*.sqlite3-journal
/public/system
/coverage/
@arbaouimehdi
arbaouimehdi / fix-wordpress-files-permissions.sh
Last active October 3, 2017 13:35
script configures WordPress file permissions based on recommendations from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#!/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
@arbaouimehdi
arbaouimehdi / docker-commands.md
Last active July 30, 2021 23:35
Docker Cheat Sheet

create a container but does not start it

docker create

allows the container to be renamed

docker rename

creates and starts a container in one operation

@arbaouimehdi
arbaouimehdi / .htaccess
Created September 18, 2017 21:25
WordPress Multisite With Top Level Domain Names (TLDs)
# BoF WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
// http://wordpress.stackexchange.com/questions/145984/change-an-li-class-name-in-a-wordpress-custom-menu-walker
<?php
class Main_Walker_Nav_Menu extends Walker_Nav_Menu {
function start_lvl( &$output, $depth = 0, $args = [] ) {
$indent = str_repeat( "\t", $depth );
switch ( $depth ) {
case 0:
$class = 'menu__list-sub';
@arbaouimehdi
arbaouimehdi / users.yml
Created June 4, 2017 18:59 — forked from henrydjacob/users.yml
devise fixtures users.yml
user1:
email: [email protected]
encrypted_password: <%= User.new.send(:password_digest, "user123") %>
confirmed_at: <%= Time.now %>
@arbaouimehdi
arbaouimehdi / secret_controller.rb
Created June 4, 2017 18:52 — forked from jwo/secret_controller.rb
Devise testing controllers - minitest / rails4
class SecretController < ApplicationController
before_filter :authenticate_user!
def show
end
end