Skip to content

Instantly share code, notes, and snippets.

@micalevisk
Last active October 21, 2018 22:01
Show Gist options
  • Save micalevisk/88dbc2dc998c8a588e73dad579331f6f to your computer and use it in GitHub Desktop.
Save micalevisk/88dbc2dc998c8a588e73dad579331f6f to your computer and use it in GitHub Desktop.
bit.ly/colabhackTP advanced options.

© 2016, 11/21 Micael Levi L. C. - All Rights Reserved.
Github repository

to inject

var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://rawgit.com/micalevisk/TAP_feelings/master/gist/questoesColab.js';
document.head.appendChild(script);

with JSON for jQuery

(fixed) for Google Chrome or Internet Edge: GitCDN RawGit

var code = '<script type="text/javascript" src="https://rawgit.com/micalevisk/TAP_feelings/master/gist/questoesColab.js" />'; 
$('head').append(code);

link-and-execute-external-javascript-file-hosted-on-github

@micalevisk
Copy link
Author

micalevisk commented Oct 24, 2016

download my constructor method generator v1.28-0 (JAVA)

using Shell, Perl and Sed*

wget https://raw.githubusercontent.com/micalevisk/TAP_feelings/master/construtor.sh
wget https://raw.githubusercontent.com/micalevisk/TAP_feelings/master/constructorGenerator.pl
wget https://raw.githubusercontent.com/micalevisk/TAP_feelings/master/removerComentarios.sed
mkdir programaConstrutor;
mv constructorGenerator.pl removerComentarios.sed construtor.sh programaConstrutor/ ;
cd programaConstrutor/ ;  chmod +x *.sh

O código deve possuir uma linha comentada com a tag "@attn", onde "N" é quantidade de atributos (declarados um por linha, abaixo desta)

execute:

./construtor.sh -d -i <File.java>

asciicast

@micalevisk
Copy link
Author

micalevisk commented Dec 3, 2016

Greasemonkey 3.9

// ==UserScript==
// @name        questoesColab
// @description features for TAP colabweb (issue1 branch).
// @namespace   http://bit.ly/colabhack
// @author      Micael Levi
// @locale      pt-br
// @include     https://webdev.icomp.ufam.edu.br/lab/
// @version     1.03-2
// @run-at      document-end
// @icon	https://raw.githubusercontent.com/micalevisk/GM_scripts/master/questoesColab/littlehead.ico
// @grant       none
// ==/UserScript==

"use strict";
(function(){

/////////////////////////////////////////// [ MAIN SOURCE ] ///////////////////////////////////////////
const gitsrc = 'https://raw.githubusercontent.com/micalevisk/TAP_feelings/issue1/gist/questoesColab.js';
////////////////////////////////////////////////////////////////////////////////////////////////////////

const REGEX_RAW_REPO_URL = /^https?:\/\/raw\.github(?:usercontent)?\.com\/([^/]+\/[^/]+\/[^/]+|[0-9A-Za-z-]+\/[0-9a-f]+\/raw)\/(.+\..+)/i;

var script = document.createElement('SCRIPT');
script.type= 'text/javascript';
script.src = gitsrc.replace(REGEX_RAW_REPO_URL, 'https://' + 'rawgit.com' + '/$1/$2');
document.head.appendChild(script);

})();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment