Skip to content

Instantly share code, notes, and snippets.

@agustibr
agustibr / cssFontStyles.css
Created September 20, 2010 10:59
Styling fonts with CSS shorthand property
.myclass { font: bold italic small-caps 1em/1.5em verdana,sans-serif; }
/* or */
.myclass {
font-weight: bold;
font-style: italic;
font-variant: small-caps;
font-size: 1em;
line-height: 1.5em;
font-family: verdana,sans-serif
}
@agustibr
agustibr / index.html
Created October 21, 2011 23:22 — forked from jpzwarte/gist:361195
thickborder
<!DOCTYPE html>
<html>
<head>
<title>Thickborder</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../reset-min.css" media="screen" rel="stylesheet" type="text/css" />
<link href="thickborder.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<body>
<nav>
@agustibr
agustibr / wp-fronted_ajax.php
Created October 21, 2011 23:49
Frontend AJAX in WordPress
<?php
//Frontend AJAX in WordPress //http://codex.wordpress.org/AJAX_in_Plugins
define('DOING_AJAX', true);
/* Assuming you will put this file in your plugin's directory */
require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'wp-load.php');
if(!isset($_REQUEST['action']) || trim($_REQUEST['action'])=='')
{
die('-1');
}
@header('Content-Type: text/html; charset='.get_option('blog_charset'));
@agustibr
agustibr / add_custom_post_types_to_dashboard.php
Created October 22, 2011 00:25
WP Collection of Code for functions.php [1]
<?php
// ADD CUSTOM POST TYPES TO THE 'RIGHT NOW' DASHBOARD WIDGET
function wph_right_now_content_table_end() {
$args = array(
'public' => true ,
'_builtin' => false
);
$output = 'object';
$operator = 'and';
@agustibr
agustibr / change_author_slug.php
Created October 22, 2011 00:48
WP Collection of Code for functions.php [2]
<?php
// Change URL Slug from Author to Sellers
function new_author_base() {
global $wp_rewrite;
$author_slug = 'sellers';
$wp_rewrite->author_base = $author_slug;
}
add_action('init', 'new_author_base');
//only run once
@agustibr
agustibr / clean-up-microsoft-word-pasted-html-tinymce.php
Created March 7, 2012 14:18
WP Collection of Code for functions.php [3]
<?php
/**
* Safe Pasting for TinyMCE (automatically clean up MS Word HTML)
*/
function tinymce_paste_options($init) {
$init['paste_auto_cleanup_on_paste'] = true;
$init['paste_convert_headers_to_strong'] = true;
return $init;
}
if( is_admin() ) add_filter('tiny_mce_before_init', 'tinymce_paste_options');
@agustibr
agustibr / pdf-compres.sh
Last active October 11, 2015 04:08
compress pdf with command line
// install PDFTK
$ sudo apt-get install pdftk
// compress pdf
$ pdftk source.pdf output destination.pdf compress
// convert PNG to PDF
$ convert *.png file.pdf
@agustibr
agustibr / Package Control.sublime-settings
Last active October 11, 2015 06:58
Sublime text 2/3 plugins
# ~/.config/sublime-text-3/Packages/User/
{
"in_process_packages":
[
],
"installed_packages":
[
"Color Highlighter",
"EditorConfig",
"Git",
@agustibr
agustibr / install-default-jre.sh
Created October 26, 2012 10:43
Installing the Java Runtime Environment
// To install the Java Runtime Environment (jre)
// First, check if the JRE is not installed:
$ java -version
// Install default-jre:
$ sudo apt-get install default-jre
@agustibr
agustibr / Preferences.sublime-settings.json
Last active October 12, 2015 15:08
Sublime text 3 : settings User json
{
"font_size": 10.0,
"save_on_focus_lost": true,
"hot_exit": false,
"ignored_packages": ["Vintage"],
"remember_open_files": false,
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", ".sass-cache"],
"indent_guide_options": ["draw_normal","draw_active"],
"default_encoding": "UTF-8",
"enable_tab_scrolling": false,