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 / dabblet.css
Created January 25, 2013 21:18
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@arbaouimehdi
arbaouimehdi / get-content.html
Created April 25, 2014 21:33
It is very simple to get content inside DIVs or inside others tags with jQuery, however, the complexity come when we try to get a particular text between two HTML tags, here is an example of solution:
<div class="parent">
<div class="first">first</div>
<div class="child1">child1</div>
Paragraph 1
<br>
Paragraph 2
<br/>
Paragraph 3
{
"vars": {},
"css": [
"tables.less",
"forms.less",
"buttons.less",
"button-groups.less",
"input-groups.less",
"navs.less",
"navbar.less",
@arbaouimehdi
arbaouimehdi / php7.1.upgrade
Created April 15, 2017 04:04 — forked from andreas22/php7.1.upgrade
Upgrade to php 7.1 in Ubuntu
accepted
There is no official PHP 7.1 in the Ubuntu 16.04 repos.
If you want PHP 7.1, there is a version available in ppa:ondrej/php
You can install it like this:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
@arbaouimehdi
arbaouimehdi / Dockerfile
Last active April 15, 2017 04:06
Build an eg_sshd image
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:screencast' | chpasswd
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
@arbaouimehdi
arbaouimehdi / deploying_app.sh
Last active June 2, 2017 16:34
Deploying Ruby on Rails App (Bitbucket)
# 1 (New App)
rails new myapp --database=postgresql
# 2 (Bundle Install)
bundle install
# 3 (Run Server)
rails server -b $IP -p $PORT
@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
@arbaouimehdi
arbaouimehdi / users.yml
Created June 4, 2017 18:59 — forked from henrydjacob/users.yml
devise fixtures users.yml
user1:
email: user1@mysite.com
encrypted_password: <%= User.new.send(:password_digest, "user123") %>
confirmed_at: <%= Time.now %>
// 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 / .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]