Skip to content

Instantly share code, notes, and snippets.

View imatteh's full-sized avatar

Haitham AlMahdi imatteh

  • iMatteh Web Design
  • Libya
  • X @imatteh
View GitHub Profile
import React, { useState } from "react"
...
function App(props) {
const existingTokens = JSON.parse(localStorage.getItem("tokens"));
const [authTokens, setAuthTokens] = useState(existingTokens);
const setTokens = (data) => {
localStorage.setItem("tokens", JSON.stringify(data));
setAuthTokens(data);
}
@generatepress
generatepress / gist:38a3d4d0e3f1be118cac76937e4c92e6
Last active September 23, 2019 17:05
Move navigation search to the secondary navigation
add_action( 'after_setup_theme', function() {
remove_action( 'generate_inside_navigation', 'generate_navigation_search' );
remove_action( 'generate_inside_navigation', 'generate_mobile_menu_search_icon' );
add_action( 'generate_inside_secondary_navigation', 'generate_navigation_search' );
add_action( 'generate_inside_secondary_navigation', 'generate_mobile_menu_search_icon' );
remove_filter( 'wp_nav_menu_items', 'generate_menu_search_icon', 10, 2 );
} );
@MWins
MWins / project-ideas01.md
Last active July 4, 2024 07:02
Back end Projects - list

Project Ideas

Ok. I'm going to list off some ideas for projects. You will have to determine if any particular idea is good enough to include in a portfolio. These aren't creative ideas. They likely already exist. Some are way too advanced while others are simplistic.

I will recommend to post any project you make to github and make a github project page for it. Explain in as much detail as possible how you made it, how it can be improved etc. Document it.

If you pick an advanced idea, setup a development roadmap and follow it. This will show some project management skills.

Another piece of advice for those who are design challenged. Use different front end frameworks and use different themes for those frameworks to provide appealing designs without looking like yet another bootstrap site.

anonymous
anonymous / gist:06dbd945fa11991d7af1a8d6800f0f87
Created September 12, 2017 21:09
Remove Archives: prefix in archives title
add_filter( 'get_the_archive_title', 'tu_archive_title_remove_prefix' );
function tu_archive_title_remove_prefix( $title ) {
if ( is_post_type_archive() ) {
$title = post_type_archive_title( '', false );
}
return $title;
}
@Claire
Claire / frontendDevlopmentBookmarks.md
Created April 9, 2017 05:14 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@Claire
Claire / Learning React Redux ES6 resources.md
Last active January 20, 2020 04:54
Here are some resources I’ve used to learn react, redux and es6
remove_action( 'storefront_footer', 'storefront_handheld_footer_bar', 999 );
@BluePraise
BluePraise / functions.php
Created February 16, 2017 08:44
How to remove sorting from the WooCommerce Storefront Theme
<?php
add_action('init','delay_remove');
function delay_remove() {
remove_action( 'woocommerce_after_shop_loop', 'woocommerce_catalog_ordering', 10 );
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10 );
}
@shashankmehta
shashankmehta / setup.md
Last active January 7, 2024 11:57
Setup PHP and Composer on OSX via Brew

First install Brew on your MAC

  • Setup Brew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • brew update
  • brew tap homebrew/dupes
  • brew tap homebrew/php
  • Install PHP 7.0.+ brew install php70
  • Install mcrypt: brew install mcrypt php70-mcrypt
  • Finally, install composer: brew install composer
@AlexisLeon
AlexisLeon / rn.input-numbers.js
Created January 15, 2017 04:28
TextInput accepts only numbers - React Native
import React, { Component } from 'react';
import { TextInput } from 'react-native';
class Input extends Component {
constructor(props) {
super(props);
this.state = {
text: ''
};
}