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 conta = new Conta(900) | |
var cliente = new Cliente() | |
// DSL bacana | |
cliente debita 500 da conta | |
println(conta saldo) | |
// classes | |
class Cliente { | |
def debita(valor: Int) = new Debito(valor, this) |
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
#!/usr/bin/env python | |
# A simple python script to grab all your photos from flickr, | |
# dump into a directory - organised into folders by set - | |
# along with any favourites you have saved. | |
# | |
# Based on FlickrTouchr 1.2 plus: | |
# - Video download support | |
# - Photo title on filename | |
# |
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
/*! | |
* $.preload() function for jQuery | |
* Preload images, CSS and JavaScript files without executing them | |
* Script by Stoyan Stefanov – http://www.phpied.com/preload-cssjavascript-without-execution/ | |
* Slightly rewritten by Mathias Bynens – http://mathiasbynens.be/ | |
* Demo: http://mathiasbynens.be/demo/javascript-preload | |
* Note that since this script relies on jQuery, the preloading process will not start until jQuery has finished loading. | |
*/ | |
$.extend({ |
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
#!/usr/bin/env python | |
## Copyright (c) 2009 Andrew D. Straw | |
## Permission is hereby granted, free of charge, to any person obtaining a copy | |
## of this software and associated documentation files (the "Software"), to deal | |
## in the Software without restriction, including without limitation the rights | |
## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
## copies of the Software, and to permit persons to whom the Software is | |
## furnished to do so, subject to the following conditions: |
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
java -jar war/WEB-INF/lib/htmlcompressor-*.jar \ | |
--type html --recursive --mask '*.jsp;*.html;*.tag;*.htm' \ | |
--compress-css --compress-js --js-compressor closure \ | |
--remove-intertag-spaces --remove-quotes \ | |
--preserve-server-script -p regex.txt \ | |
-o war/ war/ 2> /dev/null |
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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
uglify: { | |
'build/teste.js': 'src/teste.js' | |
}, | |
less: { | |
'build/estilo.css': ['src/*.less'] | |
} | |
}); |
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
server { | |
listen 3030; | |
root /Users/alura/performance-web/site; | |
gzip on; | |
gzip_types text/css application/javascript image/svg+xml; | |
} |
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 | |
for PAGINA in {1..2}; do | |
curl -s -L https://jovemnerd.com.br/categoria/nerdnews/page/$PAGINA/ | sed -n 's/.*href="\(https:\/\/jovemnerd.com.br\/nerdnews\/[^"]*\).*/\1/p' | |
done | \ | |
while read link; do | |
curl -s $link > /tmp/nerdtech.html | |
xmllint --html --xpath '//div[@class="title"]/h2/text()' /tmp/nerdtech.html 2> /dev/null |
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 | |
# Retorna o tempo total em segundos de um arquivo do ScreenFlow | |
# | |
# Requisito: Dar permissão de acessibilidade pro Terminal ou outra App que vai executar | |
# (System Preferences > Security & Privacy > Privacy > Accessibility > Add Application) | |
file=$1 | |
if [ "$file" = "" ] || [ ! -d "$file" ]; then | |
echo Passe o nome do arquivo pra detectar a duração |
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
const SECRET_KEY = "YOUR API KEY"; | |
const MAX_TOKENS = 3000; | |
const TEMPERATURE = 0.9; | |
function EMAILALUNO(aluno, nota) { | |
const url = "https://api.openai.com/v1/chat/completions"; | |
const payload = { | |
model: 'gpt-3.5-turbo', | |
messages: [ | |
{ role: "system", content: "Crie um parágrafo de incentivo para um aluno que recebeu uma nota na prova. Vou passar o nome do aluno e a nota." }, |