Skip to content

Instantly share code, notes, and snippets.

View Faisalawanisee's full-sized avatar
🎯
Focusing

Faisal Khalid Faisalawanisee

🎯
Focusing
View GitHub Profile
@Faisalawanisee
Faisalawanisee / tweets_json.php
Last active August 29, 2015 14:26 — forked from planetoftheweb/tweets_json.php
This gist will let you retrieve a series of tweets using the twitter v1.1 API. There's a few steps you have to do before you use this. 1. First, you need to go to http://dev.twitter.com/apps and create a new application. 2. You'll also need to download this library. https://github.com/themattharris/tmhOAuth (You only need the tmhOAuth.php file) …
<?php
require 'tmhOAuth.php'; // Get it from: https://github.com/themattharris/tmhOAuth
// Use the data from http://dev.twitter.com/apps to fill out this info
// notice the slight name difference in the last two items)
$connection = new tmhOAuth(array(
'consumer_key' => '',
'consumer_secret' => '',
'user_token' => '', //access token
@Faisalawanisee
Faisalawanisee / README.md
Created September 22, 2015 18:29 — forked from hofmannsven/README.md
Notes on working with Laravel CLI
@Faisalawanisee
Faisalawanisee / frontendDevlopmentBookmarks.md
Created September 22, 2015 18:57 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@Faisalawanisee
Faisalawanisee / Simple Ajax Login Form.php
Created September 13, 2016 10:19 — forked from cristianstan/Simple Ajax Login Form.php
Wordpress: Simple Ajax Login Form
<?php
//Simple Ajax Login Form
//Source: http://natko.com/wordpress-ajax-login-without-a-plugin-the-right-way/
//html
<form id="login" action="login" method="post">
<h1>Site Login</h1>
<p class="status"></p>
<label for="username">Username</label>
<input id="username" type="text" name="username">
@Faisalawanisee
Faisalawanisee / install.php
Created March 16, 2017 20:26
WordPress custom install script
<?php
/**
* WordPress custom install script.
*
* Drop-ins are advanced plugins in the wp-content directory that replace WordPress functionality when present.
*
* Language: nl
*
* if ( file_exists( WP_CONTENT_DIR . '/install.php' ) ) {
* require ( WP_CONTENT_DIR . '/install.php' );
@Faisalawanisee
Faisalawanisee / example_post_status.php
Created January 16, 2018 10:35 — forked from franz-josef-kaiser/example_post_status.php
Add a custom post status for WP (custom) post types
<?php
// No, Thanks. Direct file access forbidden.
! defined( 'ABSPATH' ) AND exit;
// INIT
add_action( 'after_setup_theme', array( 'unavailable_post_status', 'init' ) );
class unavailable_post_status extends wp_custom_post_status
{
/**
@Faisalawanisee
Faisalawanisee / iso-639-1-codes.php
Created July 16, 2018 19:07 — forked from DimazzzZ/iso-639-1-codes.php
ISO 639-1 language codes array
<?php
$codes = [
'ab' => 'Abkhazian',
'aa' => 'Afar',
'af' => 'Afrikaans',
'ak' => 'Akan',
'sq' => 'Albanian',
'am' => 'Amharic',
'ar' => 'Arabic',
@Faisalawanisee
Faisalawanisee / activate-plugin.php
Created August 10, 2018 09:39 — forked from solepixel/activate-plugin.php
Originally design to activate Andrew Norcross's Airplane Mode plugin (https://github.com/norcross/airplane-mode), this little script will allow you to activate a plugin when the WordPress admin plugin screen cannot be loaded, for whatever reason.
<?php
/**
* This file will activate the Airplane Mode plugin if not already activated. This is helpful when you do not have internet connection and you're unable to reach the WP Admin Plugins page to activate the plugin.
*/
// get WP bootstrap
define('WP_USE_THEMES', false);
require(__DIR__ . '/wp/wp-blog-header.php');
@Faisalawanisee
Faisalawanisee / unzip.php
Created August 10, 2018 09:46 — forked from solepixel/unzip.php
When load balancers have set timeouts at 30 seconds, this script will process requests that may take longer than 30 seconds (up to 15 minutes) without causing a timeout.
<?php
$cmd = "zip -9prv content_backup.zip .";
$pipe = popen($cmd, 'r');
if (empty($pipe)) {
throw new Exception("Unable to open pipe for command '$cmd'");
}
stream_set_blocking($pipe, false);
echo "\n";