Skip to content

Instantly share code, notes, and snippets.

View diogomachado's full-sized avatar
🎯
Focusing

Diogo Machado diogomachado

🎯
Focusing
View GitHub Profile
@diogomachado
diogomachado / config.xml
Last active August 29, 2016 17:48
Configurações de ícones e splashscreen - Plataforma Windows - Cordova/Phonegap/ionic
<platform name="windows">
<icon src="resources/windows/icon/Square150x150Logo.scale-100.png" width="150" height="150" />
<icon src="resources/windows/icon/Square150x150Logo.scale-240.png" width="360" height="360" />
<icon src="resources/windows/icon/Square30x30Logo.scale-100.png" width="30" height="30" />
<icon src="resources/windows/icon/Square310x310Logo.scale-100.png" width="310" height="310" />
<icon src="resources/windows/icon/Square44x44Logo.scale-240.png" width="106" height="106" />
<icon src="resources/windows/icon/Square70x70Logo.scale-100.png" width="70" height="70" />
<icon src="resources/windows/icon/Square71x71Logo.scale-240.png" width="170" height="170" />
<icon src="resources/windows/icon/StoreLogo.scale-100.png" width="50" height="50" />
<icon src="resources/windows/icon/StoreLogo.scale-240.png" width="120" height="120" />
@diogomachado
diogomachado / exemplo-modulepattern.js
Last active August 19, 2016 19:49
Padrão de projeto Javascript (Module Pattern)
// Exemplo com encapsulamento de métodos
var pedidoMesa1 = (function() {
var pedido = {};
pedido.alertar = function(msg){
alert(msg);
};
pedido.addItem = function(){
@diogomachado
diogomachado / gist:d76ac14f4aa6ebfa71f9ac28444233fa
Created July 15, 2016 23:51
Instagram captura imagens hashtag.
// Para obter o token
// $json = file_get_contents("https://instagram.com/oauth/authorize/?client_id=33ba683f581e4c8faefd4cd38d948131&redirect_uri=http://www.sofisticatta.dev&scope=public_content&response_type=token");
// $data = json_decode($json);
// dd($data);
// die();
// $json = file_get_contents("https://api.instagram.com/v1/tags/looksofisticatta/media/recent/?access_token=311684193.33ba683.9dae3610190549e0aa1bf6caa41c065b");
// $data = json_decode($json);
@diogomachado
diogomachado / gist:31e9f5547d4fe0ac8056
Created March 23, 2016 23:17
Redirect http to https
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
$("#search").keyup(function(){
_this = this;
// Mostrando apenas as linhas que combinam e escondendo o restante
$.each($("#table tbody tr"), function() {
if($(this).text().toLowerCase().indexOf($(_this).val().toLowerCase()) === -1)
$(this).hide();
else
$(this).show();
});
});
@diogomachado
diogomachado / gist:88bec26edda4048293ba
Last active May 5, 2016 17:41
Sublime text 3 configuração
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker-OceanicNext.tmTheme",
"detect_indentation": false,
"font_options":
[
"gray_antialias"
],
"font_size": 9,
@diogomachado
diogomachado / saida.json
Created November 10, 2015 23:36
Exemplo de como pensei para JSON de saída
{
"numero_bloco" : "1500",
"cliente_id" : "540",
"data_baixa" : "2015-08-12",
"motivo_id" : "2",
"romaneio" : "",
"chapas" : [
{
"numero":"1500001"
},
@diogomachado
diogomachado / float.css
Created November 7, 2015 18:38
Botão estilo google
/* Botão float */
.floating-btn{
position: fixed;
background: #9b59b6;
border: none;
font-size: 2.5em;
border-radius: 50%;
position: fixed;
display: inline-block;
padding: 9px;
@diogomachado
diogomachado / curso.php
Created August 12, 2015 12:15
Arquivo backup
<?php defined("SYSPATH") or die("No direct access allowed."); ?>
<?php require_once Kohana::find_file('views/includes', 'cabecalho-v2010'); ?>
<h1><?php echo $conteudo->get('titulo'); ?></h1>
<div id="curso">
<div id="principal"><?php echo $conteudo->get('conteudo'); ?></div>
<div id="barraLateral"><?php echo $conteudo->get('barraLateral'); ?></div>
<div class="clear"></div>
<div><?php require_once Kohana::find_file('views/includes', 'formulario-contato-coordenador'); ?></div>
</div>
<?php require_once Kohana::find_file('views/template', 'rodape'); ?>
// Access-Control headers are received during OPTIONS requests
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD']))
header("Access-Control-Allow-Methods: GET, POST, OPTIONS, DELETE, PUT");
if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']))
header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");
exit(0);