Skip to content

Instantly share code, notes, and snippets.

@halian-vilela
halian-vilela / add-compass.bash
Created October 25, 2012 01:52 — forked from inlikealion/add-compass.bash
Add Compass to an existing project (so it doesn't overwrite your files/directory structure).
compass create . --bare --sass-dir "source/assets/ss/sass" --css-dir "source/assets/ss/css" --javascripts-dir "source/assets/js" --images-dir "source/assets/img"
<!doctype html>
<html>
<head>
<!-- Encoding -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"></meta>
// History.js It!
// v1.0.1 - 30 September, 2012
// https://gist.github.com/854622
(function(window,undefined){
// Prepare our Variables
var
History = window.History,
$ = window.jQuery,
document = window.document;
@halian-vilela
halian-vilela / remove_wp-menu_css-classes.php
Created January 3, 2014 18:13
Remove WP ugly classes from menu
<?php
//Deletes all CSS classes and id's, except for those listed in the array below
function custom_wp_nav_menu($var) {
return is_array($var) ? array_intersect($var, array(
//List of allowed menu classes
'current_page_item',
'current_page_parent',
'current_page_ancestor',
'first',
'last',
@halian-vilela
halian-vilela / wp_menu_call.php
Created January 3, 2014 18:26
WP menu config
<?php
function wp_menu_call($menu_name){
wp_nav_menu
( array
(
'theme_location' => $menu_name, // as defined by "register_nav_menu( 'Menu-Handle', 'Menu Label')", located in functions.php
'menu' => '',
'container' => 'nav', // "div" or "nav" (use "nav" for HTML5)
'container_class' => $menu,
@halian-vilela
halian-vilela / WP Regex: Attachment to Upload URL
Created April 2, 2014 20:12
WP Regex: Attachment to Upload URL
-> Substitui um link de anexo para link de upload
Ex:
- - De - -
href="http://calefacao.wordpress.com/2010/12/19/dare-to-dare-in-2011/_mg_5474/
- - Para - -
@halian-vilela
halian-vilela / SassMeister-input-HTML.html
Created June 12, 2014 14:09
Generated by SassMeister.com.
<div class="box-list download-box">
<div class="box-title">downloads</div>
<ul>
<li><a href="#">Guia de Aprendizagem Rápida Action.NET<br><span class="file-size">(450kb)</span></a></li>
<li><a href="#">Palestra para Usuários Action.NET<br><span class="file-size">(450kb)</span></a></li>
<li><a href="#">Agrupamentos pontos ONS 2.7<br><span class="file-size">(450kb)</span></a></li>
<li><a href="#">Protocolo DNP 3.0 Mestre<br><span class="file-size">(450kb)</span></a></li>
<li><a href="#">Palestra SPIN CTEEP SE Centro<br><span class="file-size">(450kb)</span></a></li>
</ul>
</div>
@halian-vilela
halian-vilela / mq_helper.scss
Created June 26, 2015 17:04
[sass] Media Queries helper
// breakpoints
$S: 460px;
$M: 768px;
$L: 1170px;
// media queries
@mixin MQ($canvas) {
@if $canvas == S {
@halian-vilela
halian-vilela / _select2.scss
Created February 23, 2016 17:51
Select2 - Styling Variables
/*
Version: 3.5.4 Timestamp: Sun Aug 30 13:30:32 EDT 2015
*/
$closed-select-bg: $prim-laranja;
$closed-select-text: $sec-branco;
$closed-border: none;
$border-focus-color: transparent;
$border-focus-shadow-color: rgba(233, 102, 102, 0.7);
$opened-select-bg: $sec-rosa;
@halian-vilela
halian-vilela / time_testing.php
Created March 9, 2016 13:10
PHP-Performance testing
$start = microtime(true);
$a = array_fill(0, 100000, 'test');
$test = array();
foreach($a as $el) {
$test[] = $el;
}
$time_elapsed_secs = microtime(true) - $start;