Skip to content

Instantly share code, notes, and snippets.

View wilburhimself's full-sized avatar

Wilbur Suero wilburhimself

View GitHub Profile
@wilburhimself
wilburhimself / antares.vim
Created April 19, 2019 12:31
Antares.vim
" Name: antares.vim
" Version: 0.r1
" Maintainer: <https://github.com/wilburhimself>
set background=dark
if version > 580
highlight clear " reset syntax highlighting system to default state
if exists("syntax_on")
@wilburhimself
wilburhimself / template.js
Created April 13, 2016 02:16
Template constructor function
function template(string, options) {
var delimeters = {
open: "*(",
close: ")*"
};
var templateString = [];
var i = 1;
var closingDelimterLocation = 0;
var functionArguments = [];
{
"use_simple_full_screen": false,
// calculates indentation automatically when pressing enter
"auto_indent": true,
// sets the colors used within the text area (default)
// see https://github.com/olivierlacan/monokaim to download
// the customized Monokai I use.
"color_scheme": "Packages/Color Scheme - Default/Monokaim.tmTheme",
@wilburhimself
wilburhimself / fullscreen.html
Created November 14, 2012 22:15
HTML5 Fullscreen API
<!DOCTYPE html>
<html>
<head>
<title>FullScreen API</title>
<meta charset="utf-8" />
</head>
<body>
<h3>Click en las opciones para activar/desactivar el modo FullScreen</h3>
@wilburhimself
wilburhimself / preprocess_page_drupal7.php
Created March 26, 2011 01:41
Hook Preprocess Page Drupal 7
<?php
function phptemplate_preprocess_page(&$vars) {
if (module_exists('path')) {
$alias = drupal_get_path_alias(str_replace('/edit', '', $_GET['q']));
if ($alias != $_GET['q']) {
$template_filename = 'page';
foreach (explode('/', $alias) as $path_part) {
$template_filename = $template_filename . '__' . $path_part;
$vars['theme_hook_suggestions'][] = $template_filename;
}
@wilburhimself
wilburhimself / preprocess_page_drupal6.php
Created March 26, 2011 01:38
hook preprocess page Drupal 6
<?php
function phptemplate_preprocess_page(&$vars) {
if (module_exists('path')) {
$alias = drupal_get_path_alias(str_replace('/edit','',$_GET['q']));
if ($alias != $_GET['q']) {
$template_filename = 'page';
foreach (explode('/', $alias) as $path_part) {
$template_filename = $template_filename . '-' . $path_part;
$vars['template_files'][] = $template_filename;
}
@wilburhimself
wilburhimself / bg_less_mixing.less
Created January 14, 2011 00:02
Background images with Less.js
.bg(@filename, @repeat: 'no-repeat', @left: '0px', @top: '0px') {
background: e(%('url(http://REPLACE WITH THE ABSOLUTE URL OF YOUR IMAGES FOLDER/%s) %s %s %s', @filename, @repeat, @left, @top));
}
/*
USAGE:
Assuming the background image file is bg.png and the ABSOLUTE URL for our images folder is http://example.com/images this mixing can be used in a declaration like:
.bg("bg.png", "repeat-x");
@wilburhimself
wilburhimself / functions.php
Created December 12, 2010 23:37
Create a simple set of Wordpress Shortcodes
<?php
function get_posts_from_category($atts) {
extract(shortcode_atts(array(
'category' => '',
'num' => 5,
)));
$posts = get_posts('category_name='.$category.'numberposts='.$num);
$output = '<ul>';
foreach ($posts as $post) {
setup_postdata($post);
@wilburhimself
wilburhimself / .htaccess
Created November 28, 2010 17:04
Page controller básico
RewriteEngine on
RewriteCond $1 !^(index\.php|favicon.ico|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [L]