Skip to content

Instantly share code, notes, and snippets.

View moughamir's full-sized avatar
:shipit:
Inspecting elements

Mohamed Moughamir moughamir

:shipit:
Inspecting elements
View GitHub Profile
@moughamir
moughamir / wp-setFeatured.php
Last active August 29, 2015 14:21
Set Featured Image Automatically
<?php
/**
* @Author Avinash
* @see http://wp-snippets.com/set-featured-image-automatically/
* @package wordpress
*/
function set_featured_image_for_posts()
{
// Get all posts so set higher number,
// you can increase to any number if you have big amount of posts
@moughamir
moughamir / wp-isMobile.php
Created May 26, 2015 08:47
Mobile Detector
<?php
// Add to functions.php
// version proof, checks if the visitor is from a mobile device
function muneeb_wp_is_mobile() {
if ( function_exists( 'wp_is_mobile' ) )
return wp_is_mobile();
//code from wp_is_mobile function, wp_is_mobile() is located in wp-includes/vars.php version 3.4
static $is_mobile;
@moughamir
moughamir / wp-noBarLogo.php
Created May 26, 2015 08:49
Remove wp logo from Admin Bar
<?php
function annointed_admin_bar_remove() {
global $wp_admin_bar;
/* Remove their stuff */
$wp_admin_bar->remove_menu('wp-logo');
}
add_action('wp_before_admin_bar_render', 'annointed_admin_bar_remove', 0);
?>
@moughamir
moughamir / wp-titleTruncate.php
Last active August 29, 2015 14:21
Truncate Post Title
<?php
/**
* Paste this function in your functions.php file,
* and whenever you’re in need of truncating a title,
* call: . Where (50) is the number of Characters it allows before truncating!
*/
function customTitle($limit) {
$title = get_the_title($post->ID);
if(strlen($title) > $limit) {
@moughamir
moughamir / routes.php
Created May 27, 2015 12:28
laravel Route Exemple
Route::get('about', 'PagesController@about');
Route::get('contact','PagesController@contact');
Route::get('articles','ArticlesController@index');
Route::get('articles/{id}','ArticlesController@show');
@moughamir
moughamir / 0_reuse_code.js
Created March 14, 2016 19:52
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@moughamir
moughamir / user_profile.json
Last active March 14, 2016 20:01
user profile object with json
{
"id": 1,
"nom": "Full Name",
"genre": "Gender",
"birthday": "MM-DD-YYYY",
"subscription": "MM-DD-YYYY",
"level": "LEVEM",
"commitee": [
"1st Interest",
"2nd Interest",

Car parking game

I started this to make a car parking game. For the moment it's in prototype phase, but I'll work on it often to get it done.

Heart it if you like to see the result.

A Pen by dissimulate on CodePen.

License.

@moughamir
moughamir / Video.js Default Skin.markdown
Created April 26, 2016 02:32
Video.js Default Skin

Video.js Default Skin

This is the base skin of Video.js that can be modified to make custom skins.

The great thing about Video.js skins is they work in both HTML5 video AND Flash!

A Pen by Steve Heffernan on CodePen.

License.