Skip to content

Instantly share code, notes, and snippets.

View brunopulis's full-sized avatar
:octocat:
Vá devagar, mas vá

Bruno Pulis brunopulis

:octocat:
Vá devagar, mas vá
View GitHub Profile
@brunopulis
brunopulis / remove_paragraph.php
Created October 26, 2015 12:56
Remove paragraph wp
<?php
remove_filter ('the_content', 'wpautop');
the_content();
?>
@brunopulis
brunopulis / format_date.rb
Created November 18, 2015 12:50
Convert date to pt_br
<!-- Whitespace added for readability -->
{% assign m = page.date | date: "%-m" %}
{{ page.date | date: "%-d" }}
{% case m %}
{% when '1' %}Janeiro
{% when '2' %}Fevereiro
{% when '3' %}Mar&ccedil;o
{% when '4' %}Abril
{% when '5' %}Maio
{% when '6' %}Junho
@brunopulis
brunopulis / 0_reuse_code.js
Created December 14, 2015 12:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
Verifying that +brunopulis is my blockchain ID. https://onename.com/brunopulis
@brunopulis
brunopulis / perfectelementary.bash
Created June 30, 2016 02:31
HowTo Install the perfect Elementary-OS
#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
@brunopulis
brunopulis / font-size.scss
Created July 26, 2016 14:12
Font Size Mixin
// Font Size
// ===========================================
@mixin rem($font-size) {
font-size: $font-size;
font-size: ($font-size / $base-font-size) * 1rem;
}
/**
* get_excerpt
*
* @param [type] $limit
* @return void
*/
function excerpt( $limit ) {
$excerpt = explode(' ', get_the_excerpt(), $limit );
/**
* content
*
* Limit the size of text
*
* @param int $limit quantity to excerpt
* @return void
*/
function content($limit) {
var httpRequest;
// Mozilla, Safari
if (window.XMLHttpRequest)
httpRequest = new XMLHttpRequest();
else if (window.ActiveXObject)
// IE
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
var request = $.ajax({
url: "script.php",
method: "POST",
data: { id : menuId },
dataType: "json"
});