Skip to content

Instantly share code, notes, and snippets.

View brunoziie's full-sized avatar

bruno ziiê brunoziie

View GitHub Profile
@brunoziie
brunoziie / select.erb
Created April 11, 2014 19:29
exemplo select rails
<%=
select_tag(:city_id, options_for_select([
['Lisbon', 1],
['Madrid', 2]
], 2
))
%>
@brunoziie
brunoziie / android-ads-project
Created May 21, 2014 05:40
JSON para projeto de android na Unibratec
{
"title": "O Melhor da indie music",
"musics": [
{
"title": "What So Not - High You Are (Branchez Remix)",
"url": "https://www.youtube.com/watch?v=B2m_WnXjqnM",
"thumb": "http://img.youtube.com/vi/B2m_WnXjqnM/maxresdefault.jpg",
"duration": "3:33"
},
@brunoziie
brunoziie / checkbox-bugfix
Created May 21, 2014 17:30
Add support a checkbox
/**
* ZValidate - Um simples validador de formulários
*
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @author: Bruno Silva | eu@brunoziie.com
**/
(function (window, jQ) {
'use strict';
var callbacks = {},
validates_cpf = (cpf) ->
cpf = $.trim(cpf).replace(/\.|\-/g,'').split('')
# calculate first digit
sum = 0
i = 10
$.each(cpf.slice(0,9), ->
sum += parseInt(this)*i
i -= 1
)
define('app.youtube.search', ['app.youtube'], {
init: function () {},
/**
* Faz a requisição de uma busca
* @param {Mixed} query String com o termo a ser pesquisado ou um Objeto com os parametros (vide Youtube API Docs)
* @param {Function} callback Função de callback
* @param {Boolean} callback.error Verdadeiro quando a requisição retorna um erro
* @param {Function} callback.response Dados que retornaram na resposta da requisição
* @return {void}
[Cursos]
http://code.tutsplus.com/categories/javascript
[Palestras]
https://www.youtube.com/user/BrazilJS
[Weekly]
http://designpepper.com/js-drip-archive/
[Weekly]
<?php require_once('../Connections/conexao.php'); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "2,3";
$MM_donotCheckaccess = "false";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
@brunoziie
brunoziie / gpr
Last active August 29, 2015 14:06
GitHub Pull Request
branch=$(git name-rev --name-only HEAD)
remote_origin=$(git config --get remote.origin.url | sed 's/.*\:\(.*\)\/\(.*\)/\1/')
remote_upstream=$(git config --get remote.upstream.url | sed 's/.*\:\(.*\)\/\(.*\)/\1/')
project=$(git config --get remote.upstream.url | sed 's/.*\:\(.*\)\/\(.*\).git/\2/')
if [ -z "$1"]
then
branch_remote=$branch
else
branch_remote=$1
<ul class="pagination pagination-sm no-margin pull-right">
<li class="disabled"><span>«</span></li>
<li class="active"><span>1</span></li>
<li><a href="http://weedash.lvh.me/dash/events?page=2">2</a></li>
<li><a href="http://weedash.lvh.me/dash/events?page=3">3</a></li>
<li><a rel="next" href="http://weedash.lvh.me/dash/events?page=2">»</a></li>
</ul>
NetworkErrorController = Caviar.extend(Controller, {
beforeInitialize: function (intent) {
this.data = intent.data;
}
});