Skip to content

Instantly share code, notes, and snippets.

View micalevisk's full-sized avatar
🇧🇷
HTTP 499 ~ Adding bugs to programs.‏‏‎

Micael Levi L. Cavalcante micalevisk

🇧🇷
HTTP 499 ~ Adding bugs to programs.‏‏‎
View GitHub Profile
@micalevisk
micalevisk / colabwebQuestion.md
Last active October 21, 2018 22:01
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);
@micalevisk
micalevisk / deleteGist.sh
Last active February 1, 2018 16:44
GitHub API gist tasks CRUD
#!/bin/bash
#
# Delete a gist of http://gist.github.com/
#
# USE:
# ./deleteGist.sh <github-username> <gist-id>
#
# Created by Micael Levi on 11/26/2016
# Copyright (c) 2016 mllc@icomp.ufam.edu.br; All rights reserved.
#
@micalevisk
micalevisk / getInfoTwitchTv.js
Last active February 1, 2018 16:35
simple JS script which use Twitch.tv API v3
#!/bin/env node
// USE: ./getInfoTwitchTv.js <channelname>
'use strict';
if(process.argv.length < 2) return;
var channel = process.argv[2].trim();
if(!channel) return;
var request = require('request');
const URL = 'https://api.twitch.tv/kraken/streams/' + channel;
@micalevisk
micalevisk / conversor.js
Last active June 6, 2022 16:23
Realizar criptografia/descriptografia de textos com uma chave única #nodejs
/**
* Criptografia Simples.
* @author Micael Levi
* @version 02/03/2017
*/
String.prototype.isEmpty = function() { return !(this.trim()); }
/**
@micalevisk
micalevisk / from_hex_to_256.bash
Last active December 26, 2021 17:44
Minimal bash script to convert RGB to 256 terminal color wisely.
#!/bin/bash
## convert RGB to 256 terminal color
rgb="${1//[!0-9,]/}" # 0..255,0..255,0..255
echo -n "\e[0;38;2;${rgb//,/;}m"
@micalevisk
micalevisk / list_channels.sh
Last active December 9, 2018 23:31
Simple Shell Script to list all channels in which a Twitch TV (API v5) user is on chat
#!/bin/bash
#
# List all channels in which a Twitch TV user is on chat.
#
# USAGE:
# ./list_channels.sh <user_id> <username>
#
# Created by Micael Levi on 22/01/2018
# Copyright (c) 2018 <mllc@icomp.ufam.edu.br> All rights reserved
#
@micalevisk
micalevisk / arrow_key_detect_approaches.sh
Last active December 9, 2018 23:56
Duas abordagens para detecção de setas em Shell Script
#!/bin/bash
## solution1: $ sh arrow_key.sh
## solution2: $ sh arrow_key.sh 2 [-v]
: '
a d e f m o u ASCII
61 64 65 66 6D 6F 75 HEX
HEX ASCII
0a \n or \s
1b 5b 41 \033[A # Up arrow
@micalevisk
micalevisk / stub.sh
Last active March 17, 2018 21:06
[Linux] JAR to Executable
#!/bin/bash
# (c) https://coderwall.com/p/ssuaxa/how-to-make-a-jar-file-linux-executable
# $ cat stub.sh helloworld.jar > hello.run && chmod +x helloworld.run
MYSELF=`which "$0" 2>/dev/null`
[ $? -gt 0 -a -f "$0" ] && MYSELF="./$0"
java=java
if test -n "$JAVA_HOME"; then
java="$JAVA_HOME/bin/java"
fi
@micalevisk
micalevisk / 0respostas.md
Last active May 8, 2019 20:37
[PW 2018/1] Lista de revisão para a primeira prova
@micalevisk
micalevisk / respostas.md
Last active September 1, 2018 19:25
[PW 2018/1] Lista de revisão para a prova final

1

Tipagem dinâmica significa que os tipos das variáveis são associadas à valores, e não à variáveis. Ou seja, o tipo de uma variável é inferido em tempo de execução, o que permite que ela seja variada no decorrer do código.

<?php
$foo = 'bar'; // tipo `string`
$foo = 123;   // agora é do tipo `integer`
$foo = 1.3; // agore é do tipo `double`