Skip to content

Instantly share code, notes, and snippets.

<snippet>
<content><![CDATA[
// ${1} Resource
Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index'));
Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show'));
Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new'));
Route::get('${1}s/(:any)edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit'));
Route::post('${1}s', '${1}s@create');
Route::put('${1}s/(:any)', '${1}s@update');
Route::delete('${1}s/(:any)', '${1}s@destroy');
@mavinothkumar
mavinothkumar / SigPad.js
Last active August 29, 2015 14:26 — forked from ijason/SigPad.js
Signature Pad with HTML5
<script type="text/javascript">
$(document).ready(function () {
//User Variables
var canvasWidth = 400; //canvas width
var canvasHeight = 60; //canvas height
var canvas = document.getElementById('canvas'); //canvas element
var context = canvas.getContext("2d"); //context element
var clickX = new Array();
var clickY = new Array();
@mavinothkumar
mavinothkumar / php-webscraping.md
Created October 5, 2016 18:16 — forked from anchetaWern/php-webscraping.md
web scraping in php

Have you ever wanted to get a specific data from another website but there's no API available for it? That's where Web Scraping comes in, if the data is not made available by the website we can just scrape it from the website itself.

But before we dive in let us first define what web scraping is. According to Wikipedia:

{% blockquote %} Web scraping (web harvesting or web data extraction) is a computer software technique of extracting information from websites. Usually, such software programs simulate human exploration of the World Wide Web by either implementing low-level Hypertext Transfer Protocol (HTTP), or embedding a fully-fledged web browser, such as Internet Explorer or Mozilla Firefox. {% endblockquote %}

@mavinothkumar
mavinothkumar / functions.php
Last active January 6, 2019 08:11
Frontend Dashboard Custom Menu
<?php
/**
* From Frontend Dashboard version 1.2
*/
add_filter( 'fed_frontend_main_menu', 'fed_frontend_main_menu_fn' );
add_action( 'fed_frontend_dashboard_menu_container', 'fed_frontend_dashboard_menu_container_fn', 10, 2 );
/**
* Create custom main menu
@mavinothkumar
mavinothkumar / multiple_custom_menu
Last active September 3, 2021 11:45
Multiple Custom Menu
/**
* From Frontend Dashboard version 1.2
*/
add_filter( 'fed_add_custom_menu', 'fed_frontend_main_menu_fn' );
add_action( 'fed_frontend_dashboard_menu_container', 'fed_frontend_dashboard_menu_container_fn', 10, 2 );
/**
* Create custom main menu
*
* @param array $custom
array(
'africa' => array(
"DZ", "AO", "BJ", "BW", "BF", "BI", "CM", "CV", "CF", "KM", "CD", "DJ", "EG", "GQ", "ER", "ET",
"GA", "GM", "GH", "GN", "GW", "CI", "KE", "LS", "LR", "LY", "MG", "MW", "ML", "MR", "MU", "MA",
"MZ", "NA", "NE", "NG", "CG", "RE", "RW", "SH", "ST", "SN", "SC", "SL", "SO", "ZA", "SS", "SD",
"SZ", "TZ", "TG", "TN", "UG", "EH", "ZM", "ZW",
),
'america' => array(
"AI", "AR", "AW", "BS", "BB", "BZ", "BM", "BO", "BR", "VG", "CA", "KY", "CL", "CO", "CR", "CU",
@mavinothkumar
mavinothkumar / gist:41ba49744f5657e108f58c278dd47092
Created July 16, 2019 16:19
WordPress Plugin Update Example
{
"name": "My Example Plugin",
"version": "2.0",
"download_url": "http://example.com/updates/example-plugin.zip",
"homepage": "http://example.com/",
"requires": "4.5",
"tested": "4.8",
"last_updated": "2017-01-01 16:17:00",
"upgrade_notice": "Here's why you should upgrade...",
@mavinothkumar
mavinothkumar / gist:d46ee467cdca4b314073d41b231a19dd
Created August 2, 2019 12:09
How to change Visit Dashboard
add_filter('fed_frontend_dashboard_title_btn',function (){
return 'YOUR_CUSTOM_TEXT';
});
<?php
return array(
'NA' => array(
"AI", "AG", "AR", "AW", "BS", "BB", "BZ", "BM", "BO", "BR", "CA", "KY", "CL", "CO", "CR", "CU", "DM", "DO",
"EC", "SV", "FK", "GF", "GL", "GD", "GP", "GT", "GY", "HT", "HN", "JM", "MQ", "MX", "MS", "AN", "NI", "PA",
"PY", "PE", "PR", "KN", "LC", "PM", "VC", "SR", "TT", "TC", "US", "UY", "VE", "VG", "VI",
),
'SA' => array(
"AI", "AG", "AR", "AW", "BS", "BB", "BZ", "BM", "BO", "BR", "CA", "KY", "CL", "CO", "CR", "CU", "DM", "DO",
add_filter('illegal_user_logins', 'fed_illegal_user_logins');
/**
* @return array
*/
function fed_illegal_user_logins()
{
return array('user', 'ban', 'message');
}