Skip to content

Instantly share code, notes, and snippets.

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

Jamil Ahmed jimi008

🏠
Working from home
View GitHub Profile
@jimi008
jimi008 / Install PHP Redis Client on ec2 aws
Created September 14, 2023 14:30 — forked from vikramacharya/Install PHP Redis Client on ec2 aws
Install PHP Redis Client on ec2 aws
##### ec2-user #######
sudo yum update -y
sudo yum install -y httpd24
sudo yum install -y httpd24 php56 mysql55-server php56-mysqlnd
sudo service httpd start
sudo service httpd restart
sudo chkconfig httpd on
chkconfig --list httpd
sudo usermod -a -G apache ec2-user
groups
@jimi008
jimi008 / nav.js
Last active May 17, 2022 08:01 — forked from luboskmetko/nav.js
let el = document.querySelector('.nav');
el.className += ' is-open'; //space needed between classes
const children = Array.from(el.querySelectorAll('li')); //.map require an array
const textContents = children.map(child => child.textContent);
console.log(textContents); // should log an array of strings
@jimi008
jimi008 / teaser.scss
Last active February 11, 2022 12:05 — forked from luboskmetko/teaser.scss
.teaser {
padding: 2em;
.learn-more {
border: 1px solid $color-border;
}
svg {
width: 16px;
}
&--small {
@jimi008
jimi008 / DSND-Quizzes.py
Created January 16, 2022 17:19 — forked from jkarakas/DSND-Quizzes.py
DSND-Quizzes created by jkarakas - https://repl.it/@jkarakas/DSND-Quizzes
# DSND - Lesson 2 - Quiz 8 / 2
# Let's say that we have a line whose equation is y = -0.6x + 4. For the point (x,y) = (-5, 3), apply the square trick to get the new equation for the line, using a learning rate of alpha = 0.01alpha=0.01.
# Report your answer in the form y = w_1x + w_2, substituting appropriate values for w_1 and w_2.
a = 0.01
w1 = -0.6
w2 = 4
p = -5
@jimi008
jimi008 / wp-config-debug.php
Created January 11, 2021 12:52 — forked from jrfnl/wp-config-debug.php
Code to add to wp-config.php to enhance information available for debugging.
<?php
/**
* == About this Gist ==
*
* Code to add to wp-config.php to enhance information available for debugging.
*
* You would typically add this code below the database, language and salt settings
*
* Oh.. and *do* make sure you change the path to the log file to a proper file path on your server (make sure it exists).
*
@jimi008
jimi008 / jsonfeed2rss.php
Created April 5, 2020 22:18 — forked from daveajones/jsonfeed2rss.php
Convert JSONFeed to RSS
<?php
//Convert JSONfeed to RSS in a single function as a drop-in to make adding JSONfeed
//support to an aggregator easier
function convert_jsonfeed_to_rss($content = NULL, $max = NULL)
{
//Test if the content is actual JSON
json_decode($content);
if( json_last_error() !== JSON_ERROR_NONE) return FALSE;
@jimi008
jimi008 / example-wp-list-table.php
Created April 12, 2019 11:42 — forked from paulund/example-wp-list-table.php
An example code of using the WP_List_Table class. With Pagination.
<?php
/*
* Plugin Name: Paulund WP List Table Example
* Description: An example of how to use the WP_List_Table class to display data in your WordPress Admin area
* Plugin URI: http://www.paulund.co.uk
* Author: Paul Underwood
* Author URI: http://www.paulund.co.uk
* Version: 1.0
* License: GPL2
*/
@jimi008
jimi008 / add-wordpress-settings-page.php
Created April 3, 2019 11:28 — forked from DavidWells/add-wordpress-settings-page.php
WordPress :: Add Settings Page with All Fields
<?php
/*
Plugin Name: Homepage Settings for BigBang
Plugin URI: http://www.inboundnow.com/
Description: Adds additional functionality to the big bang theme.
Author: David Wells
Author URI: http://www.inboundnow.com
*/
// Specify Hooks/Filters
@jimi008
jimi008 / functions.php
Created December 19, 2018 14:27 — forked from eugenoprea/functions.php
Gravity Forms - Checkbox Dynamic Population
// When true, the form will be saved to DB after dynamic population
define('EO_SAVE_FORM_ON_PRE_RENDER', true);
// Adds a filter to form id 7. Replace 26 with your actual form id
add_filter('gform_pre_render_7', 'eo_populate_checkbox');
add_filter('gform_admin_pre_render_7', 'eo_populate_checkbox');
function eo_populate_checkbox($form) {
if (EO_SAVE_FORM_ON_PRE_RENDER)
@jimi008
jimi008 / git-deployment.md
Created December 14, 2018 16:17 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.