Skip to content

Instantly share code, notes, and snippets.

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

Mohammed Saimon saimonh3

🏠
Working from home
View GitHub Profile
#!/bin/bash
clear
# Remove/Uninstall process
echo "WordPress Installation Starts :)"
if [[ $1 == "remove" ]]; then
# Grab the project name
if [[ -z $2 ]]; then
echo "WP Project to remove: "
@saimonh3
saimonh3 / remove-woocommerce-styles-scripts.php
Created January 18, 2017 14:37 — forked from gregrickaby/remove-woocommerce-styles-scripts.php
Remove WooCommerce styles and scripts.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php
/**
* Manage WooCommerce styles and scripts.
*/
function grd_woocommerce_script_cleaner() {
// Remove the generator tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@saimonh3
saimonh3 / custom-post-type.php
Created December 24, 2016 04:34
WordPress Custom Post Type
<?php
//Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
function dwwp_register_post_type() {
$singular = 'Job';
$plural = 'Jobs';
$slug = str_replace( ' ', '_', strtolower( $singular ) );
@saimonh3
saimonh3 / php
Created December 13, 2016 09:01
Getting User info using Facebook API.
<?php
session_start();
require_once __DIR__ . '/src/Facebook/autoload.php';
$fb = new Facebook\Facebook([
'app_id' => 'APP_ID',
'app_secret' => 'APP_SECRET',
'default_graph_version' => 'v2.5',
]);
$helper = $fb->getRedirectLoginHelper();
$permissions = ['user_birthday', 'user_location', 'user_website']; // optional
<?php
$_fp = fopen("php://stdin", "r");
while($string = fgets($_fp)){
$string = strtolower($string);
$string = str_replace(' ', '', $string);
$string = str_split($string);
$abc = range('a', 'z');
$gap = array_diff($abc, $string);