Skip to content

Instantly share code, notes, and snippets.

View imatteh's full-sized avatar
🏠
Working from home

Haitham AlMahdi imatteh

🏠
Working from home
  • iMatteh Web Design
  • Libya
  • X @imatteh
View GitHub Profile
@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: ''
};
}
@abhishekbhardwaj
abhishekbhardwaj / php71.sh
Created January 15, 2017 03:00
Install PHP7.1 on OSX with Homebrew
brew update
brew upgrade
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install php71
## To use PHP7.1 on CLI, add this to .bash_profile
@Lego2012
Lego2012 / recent-posts-function.php
Last active April 15, 2018 22:13
Recent Posts Function #wordpress
<!-- http://codex.wordpress.org/Template_Tags/wp_get_archives -->
<!-- Technique #1 -->
<!-- This function is useful when you need to display content, excerpt, custom fields, or anything related to the post beyond it's link and title. If you just need a list of linked titles, see the next technique. Put the following function in functions.php -->
function recent_posts($no_posts = 10, $excerpts = true) {
global $wpdb;
@aliaghdam
aliaghdam / visual-composer-rtl-fix.js
Last active February 5, 2022 09:34
WordPress Visual Composer full width row ( stretche row ) fix for RTL
jQuery(document).ready(function() {
function bs_fix_vc_full_width_row(){
var $elements = jQuery('[data-vc-full-width="true"]');
jQuery.each($elements, function () {
var $el = jQuery(this);
$el.css('right', $el.css('left')).css('left', '');
});
}
@morgyface
morgyface / faq.php
Created July 21, 2016 10:09
Wordpress | ACF | FAQs
<style>
div.questions {padding:4em 0; clear:both}
div.questions h2 {font-size:2em; color:#111}
div.questions ul {margin:2em auto; max-width:800px; padding:0; list-style:none; font-size:1em; line-height:3em}
div.questions ul li {border-top:1px solid #DDD}
div.questions ul li a {color:#07F; border-bottom:1px solid transparent; -webkit-transition:border-color 0.5s ease-in-out; -moz-transition:border-color 0.5s ease-in-out; -o-transition:border-color 0.5s ease-in-out; transition:border-color 0.5s ease-in-out}
div.questions ul li a:hover {border-color:#07F}
div.faqs {background-color:#DDD; padding:1em 0; clear:both}
div.faqs dl {width:100%; max-width:800px; margin:0 auto}
div.faqs dl dt {font-size:3em; color:#111; margin:0 0 1em 0; padding-top:2em}
@krambertech
krambertech / Component.jsx
Created July 2, 2016 10:44
ReactJS: Input fire onChange when user stopped typing (or pressed Enter key)
import React, { Component } from 'react';
import TextField from 'components/base/TextField';
const WAIT_INTERVAL = 1000;
const ENTER_KEY = 13;
export default class TextSearch extends Component {
constructor(props) {
super();
@AbhishekGhosh
AbhishekGhosh / Recent-Posts.php
Created April 23, 2015 07:42
Recent Posts WordPress PHP
<?php
function dee_display_recent_posts() {
$args = array(
'post_type' => 'post',
'posts_per_page'=> 5,
'cat'=> 4,
);
$dee_recent_posts = new WP_Query( $args );
@BluePraise
BluePraise / functions.php
Last active April 14, 2018 12:21
Remove Contactform7 scripts from WP pages
// Put this script in your functions.php
// I have very little pages, and I am sure it can be improved
// or adjusted to suit your own project.
//Deregister the scripts.
function deregister_contact_form() {
// You can put here all the pages where there is no contact form
if ( ! is_page( 'contact' ) ) {
remove_action('wp_enqueue_scripts', 'wpcf7_enqueue_scripts');
}
@bacalj
bacalj / gist:18dac320b5d32b249207
Last active May 22, 2018 23:03
getting acf repeater into bootstrap tabs
<?php if (have_posts()) : while(have_posts()) :the_post();?>
<div class="post-single" id="post-<?php the_ID(); ?>">
<div class="post-body">
<!-- START CONTENT -->
<?php the_content();
//if there are tabs - open up a tabset ul
if( get_field('tab') ) {
echo ('<ul class="nav nav-tabs" role="tablist">');