Skip to content

Instantly share code, notes, and snippets.

Andre Cardoso andrebian

View GitHub Profile
@andrebian
andrebian / current-time-events.html
Created Aug 25, 2018
Youtube iframe API - Eventos baseado no tempo atual do video (current time events)
View current-time-events.html
<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 Apr 28, 2018
Configurando mais de um repositório
View remotes-git.sh
# 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 Dec 9, 2016
A WhatsApp Web loading clone
View zap-loading.html
<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>
View onename
Verifying that +andrebian is my blockchain ID. https://onename.com/andrebian
View RequestPost.java
class RequestPost {
public Boolean isJson(String str) {
try {
new JSONObject(str);
} catch (JSONException ex) {
View ApiRequestExample.swift
//
// ViewController.swift
// apirequest
//
// Created by Andre Cardoso on 9/24/15.
//
import UIKit
import Foundation
View CameraViewController.swift
import UIKit
import MobileCoreServices
class ViewController: UIViewController, UINavigationControllerDelegate, UIImagePickerControllerDelegate {
@IBOutlet weak var imgView: UIImageView!
var newMedia: Bool?
View ModelOrder.php
<?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
View Excel.php
<?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 Mar 25, 2015
Um .htaccess para melhoras significativas de pagespeed
View .htaccess
# Ativando compactação
<FilesMatch ".(js|css|html|htm|php|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>
# Ativando cache no browser
<IfModule mod_expires.c>
ExpiresActive on
You can’t perform that action at this time.