Skip to content

Instantly share code, notes, and snippets.

View gffcoutinho's full-sized avatar

Guilherme Coutinho gffcoutinho

View GitHub Profile
@gffcoutinho
gffcoutinho / install.sh
Last active June 18, 2024 19:50 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 18.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@gffcoutinho
gffcoutinho / cookbook.interval.js
Last active August 29, 2015 14:25
Javascript Cookbook
(function(){
if(typeof(document) == "undefined") {document = new ActiveXObject("htmlfile"); document.write("<html></html>");}
if(typeof(window ) == "undefined") window = document.parentWindow;
if(typeof(alert) == "undefined") alert = function(s) {return window.alert(s)};
if(typeof(confirm) == "undefined") confirm = function(s) {return window.confirm(s) };
if(typeof(location) == "undefined") location = window.location;
if(typeof(navigator) == "undefined") navigator = window.navigator;
if(typeof(clearInterval) == "undefined") clearInterval = function(id) {return window.clearInterval(id);};
if(typeof(clearTimeout) == "undefined") clearTimeout = function(id) {return window.clearTimeout(id);};
if(typeof(setInterval) == "undefined") setInterval = function(code, interval) {return window.setInterval(code, interval);}
@gffcoutinho
gffcoutinho / boilerplate.hta.htm
Last active September 29, 2022 14:37
Angular.js
<!DOCTYPE html>
<html lang="en" ng-app="application">
<head>
<title>Application Title</title>
<hta:application
ID="application"
APPLICATIONNAME="application"
SYSMENU="yes"
SCROLL="yes"
CAPTION="yes"
var console = {
log: function( v ) {
var str = (function stringify( obj, unquote ) {
if ( obj === null ) return 'null';
if ( obj === undefined ) return 'undefined';
if ( obj instanceof Array ) {
var str = [];
for ( var i = 0; i < obj.length; ++i ) {
str.push( stringify( obj[i] ));
}
<?xml version="1.0"?>
<?job error="true" debug="true"?>
<package id="Default">
<job id="Autoload">
<script language="JScript" src="shim.js" />
<script language="JScript" src="console.js" />
<script language="JScript"><![CDATA[
// caso o script seja iniciado ao se clicar duas vezes no arquivo, ele para. para iniciar corretamente o script deve-se usar o cscript ao invés do wscript
if (/wscript\.exe/i.test(WScript.FullName)) {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=9" />
<title>Timer</title>
<HTA:APPLICATION
APPLICATIONNAME="Timer"
SCROLL="yes"
WINDOWSTATE="minimize"
@if (true == false) @end /*
@echo off
cscript //nologo //e:javascript "%~dpnx0" %*
pause
goto :EOF */
WScript.Echo('Hello from JScript');