Skip to content

Instantly share code, notes, and snippets.

View brcontainer's full-sized avatar
👽
Try Inphinit PHP framework today!

Guilherme Nascimento brcontainer

👽
Try Inphinit PHP framework today!
View GitHub Profile
@brcontainer
brcontainer / inject-script-in-qwebframe.cpp
Last active March 13, 2016 03:06
Inject script in QWebFrame
QObject::connect(ui->webView, SIGNAL(loadFinished(bool)), this, SLOT(loadedWebView(bool)));
...
void Form::loadedWebView(const bool a) {
Q_UNUSED(a);
QString scriptContent = "function TEST() { alert(1); }";
QString injectionJS = "(function() { var newdom = document.createElement('script');";
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@brcontainer
brcontainer / laravel-windows-server-iis.md
Created March 13, 2016 03:02 — forked from leabdalla/laravel-windows-server-iis.md
How to use Laravel in Windows IIS

Laravel 4 in Windows Server IIS

###1. Put this web.config in laravel root diretory

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
		<defaultDocument>
 

Laravel 5 in Windows IIS

  1. Create a web.config file in laravel root diretory
  2. Put this content in web.config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <defaultDocument>

Getting start

Install Whoops (prefer version 2)

cd projectfolder
composer require filp/whoops

Or edite composer.json and set require values, like this:

@brcontainer
brcontainer / current-path.sh
Created August 1, 2016 23:46
Obtain the path of the script and the way in which he was called (has not been tested yet, it is just to study)
#!/usr/bin/env bash
SCRIPT_PATH=$(realpath "$0")
CALLING_FROM=$(pwd)
if [ -d "$CALLING_FROM" ]; then
CALLING_DIR=$CALLING_FROM
else
CALLING_DIR=$(dirname "$CALLING_FROM")
fi
@brcontainer
brcontainer / main.cpp
Created October 4, 2016 20:02
QT example for Wallace
#include "wallacewindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
WallaceWindow w;
w.show();
return a.exec();
@brcontainer
brcontainer / ux-homologation.js
Last active December 9, 2016 13:18
Ajuda a distinguir o ambiente de homologação do de produção baseado pelo domínio
// ==UserScript==
// @name UxHomologation
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Ajuda a detectar se esta em que ambiente baseado no domínio
// @author Guilherme Nascimento
// @match *://dominio-do-ambiente-de-homologação.com.br/*
// @grant none
// ==/UserScript==
@brcontainer
brcontainer / cdata-to-dom.php
Last active April 12, 2017 01:45
Get images in CDATA (FEED/RSS)
<?php
/*
* http://pt.stackoverflow.com/a/197684/3635
*/
$imagem = array();
$items = simplexml_load_file("http://cidades.gov.br/ultimas-noticias?format=feed&type=rss")->channel->item;
$doc = new DOMDocument;
@brcontainer
brcontainer / bug-stack-overflow.txt
Created April 17, 2017 19:19
bug stack overflow and stack snippet
1. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam nunc mi, euismod id dapibus sed, sodales id mi.
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
teste 1
<!-- end snippet -->