Skip to content

Instantly share code, notes, and snippets.

View antoniofrignani's full-sized avatar
👨‍💻

Antonio Frignani antoniofrignani

👨‍💻
View GitHub Profile
@antoniofrignani
antoniofrignani / index.html
Last active June 28, 2018 13:36
Back To top CSS
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en-US"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en-US"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class=" js no-touch svg inlinesvg svgclippaths no-ie8compat" lang="en-US" style="overflow: hidden;" id="ls-global"><!--<![endif]-->
<head>
</head>
<body>
<a href="#" id="linkTop" class="backtotop"></a>
@antoniofrignani
antoniofrignani / dabblet.css
Created September 27, 2012 08:41 — forked from LeaVerou/dabblet.css
Links with arrow background
/**
* Links
*/
body {
background: #FFDEDB;
}
a {
display: inline-block;
@antoniofrignani
antoniofrignani / snippet.xml
Created September 13, 2012 21:44 — forked from JeffreyWay/snippet.xml
Laravel Resource - Sublime Text 2 Snippet
<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');
@antoniofrignani
antoniofrignani / bootstrap-grid.css
Created July 12, 2012 15:25 — forked from abitgone/bootstrap-grid.css
[BOOTSTRAP] Grid Overlay for Twitter Bootstrap
/*
* Grid Overlay for Twitter Bootstrap
* Assumes a 1.692em baseline grid (22px/13px)
*/
@media (min-width: 1200px) {
body {
background: -webkit-gradient(linear, top left, bottom left, color-stop(0%, rgba(0, 0, 0, 0.05)), color-stop(4.545%, rgba(0, 0, 0, 0.05)), color-stop(4.545%, rgba(0, 0, 0, 0)), color-stop(100%, rgba(0, 0, 0, 0))), -webkit-gradient(linear, top left, top right, color-stop(0%, rgba(0, 0, 0, 0)), color-stop(35%, rgba(0, 0, 0, 0)), color-stop(35%, rgba(0, 0, 0, 0.05)), color-stop(36%, rgba(0, 0, 0, 0.05)), color-stop(36%, rgba(0, 0, 0, 0)), color-stop(65%, rgba(0, 0, 0, 0)), color-stop(65%, rgba(0, 0, 0, 0.05)), color-stop(66%, rgba(0, 0, 0, 0.05)), color-stop(66%, rgba(0, 0, 0, 0)), color-stop(100%, rgba(0, 0, 0, 0))), -webkit-gradient(linear, top left, top right, color-stop(0%, rgba(0, 0, 0, 0)), color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(0.085%, rgba(0, 0, 0, 0.1)), color-stop(0.085%, rgba(0, 0, 0, 0)));
background: -webkit-linear-gradient(90deg, rgba(0, 0, 0, 0.05), rgba(
@antoniofrignani
antoniofrignani / base.php
Created June 22, 2012 11:44 — forked from purwandi/base.php
[LARAVEL] My Base Model for Laravel
<?php
/**
* Base Model
*
* @package Extends Model Laravel
* @version 1.0
* @author Purwandi <[email protected]>
* @link http://purwand.me
*/
class Base extends Eloquent{
@antoniofrignani
antoniofrignani / auth.php
Created June 22, 2012 11:29 — forked from mwesten/auth.php
[LARAVEL] Laravel 3 Auth Controller
<?php
class Auth_Controller extends Base_Controller {
public $restful = true;
public function __construct() {
$this->filter( 'before', 'guest' )->except( array( 'logout', 'validate' ) );
// Note: We may not always require CSRF on login for system based logins so ignore it here.
$this->filter( 'before', 'csrf' )->on( 'post' )->except( array( 'login' ) );
}
@antoniofrignani
antoniofrignani / gist:2972206
Created June 22, 2012 11:28
[LARAVEL] Compress filter for Laravel
<?php
/*
|--------------------------------------------------------------------------
| Compress output before sending it to the browser
|--------------------------------------------------------------------------
|
| Removes all tabs and line breaks from the content before sending it to
| the browser.
|
@antoniofrignani
antoniofrignani / gist:2867556
Created June 4, 2012 09:57
[WP] - Create multiple search templates for custom post types
// http://wpsnipp.com/index.php/template/create-multiple-search-templates-for-custom-post-types/
/*
Create a new file called search.php and add the following search template.
Change the $search_refer= CUSTOM_POST_TYPE to the names of your post types.
You will also need to change the template path to the corresponding template you wish to display results.
*/
<?
/* Template Name: Search Results */
@antoniofrignani
antoniofrignani / gist:2867546
Created June 4, 2012 09:54
[WP] - Track post views without a plugin using post meta
// http://wpsnipp.com/index.php/functions-php/track-post-views-without-a-plugin-using-post-meta/
// functions.php
function getPostViews($postID){
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
if($count==''){
delete_post_meta($postID, $count_key);
@antoniofrignani
antoniofrignani / gist:2867542
Created June 4, 2012 09:51
[WP] - Rewrite the search results slug to /search/term
// http://wpsnipp.com/index.php/functions-php/rewrite-the-search-results-slug-search-term/
function search_url_rewrite_rule() {
if ( is_search() && !empty($_GET['s'])) {
wp_redirect(home_url("/search/") . urlencode(get_query_var('s')));
exit();
}
}
add_action('template_redirect', 'search_url_rewrite_rule');