Skip to content

Instantly share code, notes, and snippets.

View andrebian's full-sized avatar

Andre Cardoso andrebian

View GitHub Profile
@andrebian
andrebian / current-time-events.html
Created August 25, 2018 22:51
Youtube iframe API - Eventos baseado no tempo atual do video (current time events)
<div id="player" data-video-id="ZZ5LpwO-An4"></div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
var tag = document.createElement('script');
var firstScriptTag = document.getElementsByTagName('script')[0];
// O container do video
var playerDiv = $('#player');
@andrebian
andrebian / remotes-git.sh
Created April 28, 2018 22:38
Configurando mais de um repositório
# Adicionando o primeiro repositório, do Github
$ git remote add origin git@github.com:seu_user/seu_projeto.git
# Agora adicionando um segundo repositório, vou nomear como **build**
git remote add build ssh://user@server/pasta_do_repositorio.git
## Obtendo atualizações dos repositórios
@andrebian
andrebian / zap-loading.html
Last active December 9, 2016 11:50
A WhatsApp Web loading clone
<html>
<head>
<title>Zap Loading - A WhatsApp Web loading clone</title>
<meta charset="UTF-8">
<meta name="description" content="A WhatsApp Web loading clone">
<meta name="keywords" content="loading, loading svg">
<style>
Verifying that +andrebian is my blockchain ID. https://onename.com/andrebian
class RequestPost {
public Boolean isJson(String str) {
try {
new JSONObject(str);
} catch (JSONException ex) {
//
// ViewController.swift
// apirequest
//
// Created by Andre Cardoso on 9/24/15.
//
import UIKit
import Foundation
import UIKit
import MobileCoreServices
class ViewController: UIViewController, UINavigationControllerDelegate, UIImagePickerControllerDelegate {
@IBOutlet weak var imgView: UIImageView!
var newMedia: Bool?
<?php
public function beforeFind($queryData)
{
parent::beforeFind($queryData);
// Verifica se o primeiro campo da ordenação está setado
if (!empty($queryData['sort']) && $queryData['sort'] == 'primeiro_campo') {
// Caso esteja, adiciona o segundo elemento junto à ordenação padrão
<?php
/**
* Simple excel writer class with no external dependencies, drop it in and have fun
* @author Matt Nowack
* @link https://gist.github.com/ihumanable/929039/edit
* @license Unlicensed
* @version 1.0
*/
class Excel {
@andrebian
andrebian / .htaccess
Created March 25, 2015 16:33
Um .htaccess para melhoras significativas de pagespeed
# Ativando compactação
<FilesMatch ".(js|css|html|htm|php|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>
# Ativando cache no browser
<IfModule mod_expires.c>
ExpiresActive on