This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* csrfValidation.js | |
* | |
* use: | |
* $ npm i cheerio | |
* $ node ./csrfValidation <hostname> (e.g. www.googleauth.com/csrfFormAuth) | |
* | |
* written by Alexandre Mulatinho | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = require('../main.js'); | |
var request = require('supertest'); | |
var chai = require("chai"); | |
describe('A list of tests', function() { | |
describe('#GET /questions', function() { | |
it('should get a list of questions', function(done) { | |
request(app) .get('/questions') | |
.end(function(err, res) { | |
expect(res.statusCode).to.equal(200); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = require('../main.js'); | |
var request = require('supertest'); | |
var chai = require("chai"); | |
describe('A list of tests', function() { | |
describe('#GET /questions', function() { | |
it('should get a list of questions', function(done) { | |
request(app) .get('/questions') | |
.end(function(err, res) { | |
expect(res.statusCode).to.equal(200); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Upload to Amazon S3 without AWS-SDK or other modules | |
* Alexandre Mulatinho <alex at mulatinho.net> 2016 | |
* | |
* You will need to change: | |
* - YOUR_FILENAME_HERE | |
* - YOUR_BUCKET_HERE | |
* - AWS_SECRET_KEY_HERE | |
* - AWS_ACCESS_KEY_HERE */ | |
var https = require("https"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# amazon s3 upload file code | |
# written by Alexandre Mulatinho < alex @ mulatinho . net > | |
# Wed Oct 26 09:30:54 BRT 2016 | |
# use -> ./s3upload.sh hostAmazon yourBucketName yourFilename | |
[ ! "$3" ] && echo "use: $0 <host> <bucket> <file>" && exit 1 | |
dateNow="`TZ=Africa/Bumako date "+%a, %0e %b %Y %T %z"`" | |
host="$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://alex.mulatinho.net/2016/08/17/desafio-shell-script-001/ | |
# Alexandre Mulatinho - http://alex.mulatinho.net - 20160820 | |
# | |
# run tests: | |
# $ ( TESTES=$(( (RANDOM % 20) + 1 )); echo $TESTES; \ | |
# for i in `seq 1 $TESTES`; \ | |
# do N=$(( (RANDOM % 5) + 1 )) ; echo -n "$N "; \ | |
# for x in `seq 1 $N`; do DIA=$(( (RANDOM % 31) + 1)); echo -n "$DIA "; done; \ | |
# echo; done; echo $(( (RANDOM % 12) +1 )) ) | ./challenge001.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
initial - representa o valor inicial investido; | |
interest - a taxa de rendimento médio mensal; | |
months - o número de meses em que o investimento será realizado; | |
$ initial=50000; interest=1.00961; months=60; for i in `seq 1 $months`; do initial=`echo "scale=2; $initial * $interest"|bc`; printf "month %2d, r$ %12.2f\n" $i $initial; done | |
month 1, r$ 50480.50 | |
month 2, r$ 50965.62 | |
month 3, r$ 51455.40 | |
month 4, r$ 51949.88 | |
month 5, r$ 52449.12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// algoritmo: res1 = sum(digits[0-9] * 10...2) % 11; res2 = sum(digits[0-10] * 11...2) % 11 | |
// if (digit10 == res1 && digit11 && res2) { cpf valido } | |
func checkIfCPFisValid(obj: AnyObject?) -> Bool | |
{ | |
var input: String = "" | |
if let object = obj as? UITextField { | |
input = object.text! | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AreUFuknWithMe { | |
let rake = 0.26; | |
var total: Double = 0; | |
let bills: [Double] = [ 1, 1.87, 2, 4.3, 6.57 ]; | |
init() { | |
var x = 0; | |
for (; x<4; x++) { | |
println("Duh") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source /etc/profile.d/32dev.sh | |
# export ARCH=i486 | |
# source *info; wget -c $DOWNLOAD; sh *SlackBuild | |
# installpkg /tmp/OpenAL-1.16.0-i486-1_SBo.tgz |
NewerOlder