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
@ilkka
ilkka / archivepage.rb
Created November 19, 2010 19:37
Jekyll ArchivePage class
module Jekyll
class ArchivePage
include Convertible
attr_accessor :site, :pager, :name, :ext, :basename, :dir, :data, :content, :output
# Initialize new ArchivePage
# +site+ is the Site
# +month+ is the month
# +posts+ is the list of posts for the month
@chrisjacob
chrisjacob / README.md
Created February 18, 2011 03:44
Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Intro

Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Author: Chris Jacob @_chrisjacob

Tutorial (Gist): https://gist.github.com/833223

The Result

@timkelty
timkelty / config.rb
Created January 11, 2012 15:28
Compass config.rb
# Note that while this file is in our config folder, it is
# symlinked to our site folders, so paths are relative from there
# Require gems and Compass plugins
# require 'rgbapng'
# require 'compass-fancybox-plugin'
require 'compass-growl'
# General
output_style = :expanded
@sergiolopes
sergiolopes / README.md
Created February 28, 2012 21:57
Pure CSS fix to iOS zoom bug on device rotation

My approach to fix the iOS bug is documented here:

https://github.com/sergiolopes/ios-zoom-bug-fix

Here I present one experiment with a pure CSS solution, no JS required. It uses width=device-width normally (no device-height hacking) and scales down the page on landscape.

Works fine on all iOS versions.

There's only one problem: on old iOS versions (prior to 4.3.5), the page will get a big empty space at bottom, below the content, when on landscape. Recent iOS versions don't show this behavior.

@ografael
ografael / combo_dinamico.html
Created March 14, 2012 15:12
Carregar combo com JQuery - Cidades e Estados
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$.getJSON('estados_cidades.json', function (data) {
@AbraaoAlves
AbraaoAlves / javaScript - Boas Praticas (1).markdown
Created June 14, 2012 17:17
Evitando variáveis globais e modularizando o código

Variáveis globais quase sempre são uma má ideia, mas como fugir delas em javascript ? É simples: não dá, o que podemos fazer é minimizar o número de variáveis globais.

Entendendo o problema:

O uso de variáveis globais é principal forma de trocar informações entre módulos javascript, então como usa-las sem diminuir a qualidade do código ?

Algumas maneiras de como resolver isso:

Anonymous Closures

@erickarbe
erickarbe / .htaccess file - HTML5 Boilerplate
Created July 9, 2012 12:12
HTML5 Boilerplate .htaccess file - easy access
# Apache configuration file
# httpd.apache.org/docs/2.2/mod/quickreference.html
# Note .htaccess files are an overhead, this logic should be in your Apache config if possible
# httpd.apache.org/docs/2.2/howto/htaccess.html
# Techniques in here adapted from all over, including:
# Kroc Camen: camendesign.com/.htaccess
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
# Sample .htaccess file of CMS MODx: modxcms.com
@gabeidx
gabeidx / jquery.liveFilter.js
Created September 18, 2012 11:30
Filter table rows as you type on a input field.
/**
* Filter table rows as you type
*
* == How to use ==
* Just add the script to the page and, on the input element,
* add the data-filter attibute with the selector to the table.
* <input type="search" data-filter="#tableID">
*
* == Acknowledgements ==
* This was inspired by jresig's liveUpdate plugin used on jQuery's
@zenorocha
zenorocha / README.md
Last active May 28, 2024 08:23
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@zenorocha
zenorocha / multiple-3rd-party-widgets.js
Last active November 14, 2022 12:18
Loading multiple 3rd party widgets asynchronously
(function() {
var script,
scripts = document.getElementsByTagName('script')[0];
function load(url) {
script = document.createElement('script');
script.async = true;
script.src = url;
scripts.parentNode.insertBefore(script, scripts);