View _service.md

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
View gist:cf3fdb9d1cf0eb53c3e27cabf022a91a
$(document).ready(function() {
// add a hash to the URL when the user clicks on a tab
$('a[data-toggle="tab"]').on('click', function(e) {
history.pushState(null, null, $(this).attr('href'));
});
// navigate to a tab when the history changes
window.addEventListener("popstate", function(e) {
var activeTab = $('[href="' + location.hash + '"]');
if (activeTab.length) {
activeTab.tab('show');
View SlideShare.php
<?php
class Zend_Service_SlideShare
{
/**
* Converts a SimpleXMLElement object representing a response from the service
* into a Zend_Service_SlideShare_SlideShow object
*
* @param SimpleXMLElement $node The input XML from the slideshare.net service
* @return Zend_Service_SlideShare_SlideShow The resulting object
View haertblaad.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
if __name__ == '__main__':
file = open("heartbleed.txt")
lines = ""
for line in file:
aux = list(line)
for i in range(len(aux)):
if aux[i] == "a":
View dica-02.hex
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gYdABEHBG4brgAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAlWSURBVHja7d0hS2txHMfhs+uCIL4Ai2AwGCwKKgwUbAPbgiIIwhA0iAbLQNPAZrGIWOaKZSBYDILLFhEGgt20gZpWva/gXn7jnqPX7XnyFzn+9cCHfzm5JEk+EwAABsYvRwAAIAABABCAAAAIQAAABCAAAAIQAAABCACAAAQAQAACACAAAQAQgAAACEAAAAQgAAACEABAAAIAIAABABCAAAAIQAAABCAAAAIQAAABCACAAAQAQAACACAAAQAQgAAACEAAAAQgAAACEABAAAIAIAABABCAAAAIQAAABCAAAAIQAAABCACAAAQAQAACACAAAQAQgAAACEAAAAQgAIAABABAAAIAIAABABCAAAAIQAAABCAAAAIQAAABCACAAAQAQAACACAAAQAQgAAACEAAAAQgAIAABABAAAIAIAABABCAAAAIQAAABCAAAAIQAAABCACAAAQAQAACACAAAQAQgAAACEAAAAEIAIAABABAAAIAIAABABCAAAAIQAAABCAAAAIQAAABCACAAAQAQAACACAAAQAQgAAACEAAAAEIAIAABABAAAIAIAABABCAAAAIQAAABCAAAAIQAAABCACAAAQAQAACABCTdwQAfzcxMRHeFgqF8Pbx8TG8fX5+zuR3W1hYCG/n5ubC21arFd42m80f9f9QKpXC21wuF942Gg0vG1/GDSAAgAAEAEAAAgAgAAEAEIAAAAhAAAAEIAAAAhAAAAEIAIAABAAgDbkkST4dAzBohoaGwtuHh4fwdnZ2Nrw9ODgIb09OTsLb1dXV8Pby8jK8rdVq4e36+np4e3h4GN6enp5m8v+wsb
View gerar-certificados-flisol.md

Baixe o projeto: https://www.dropbox.com/s/ep3t7h12ypkottg/flisol-cert.tar.bz2

  1. extrair
  2. instalar php5 e php5-gd (apt-get install php5 php5-gd)
  3. abre um terminal
  4. entra no diretorio do projeto
  5. você encontrará um arquivo chamado ParticipantesFlisol.ods, esse arquivo deverá conter o nome dos participantes. Abra o arquivo exemplo e veja como ele deve ser montado.
  6. Mude também o modelo do certificado em img/modelo.jpg. Use o mesmo tamanho e formato para melhor qualidade do certificado.
  7. executa ./gerar.sh. Esse script irá converter os dados para CSV e fazer um certificado para cada nome encontrado.
  8. tomar um café, porque vai demorar um pouco, mas dá pra acompanhar o processo na tela :)
View SlideShare.php
protected function _slideShowNodeToObject(SimpleXMLElement $node)
{
if($node->getName() == 'Slideshow') {
$ss = new Zend_Service_SlideShare_SlideShow();
$ss->setId((string)$node->ID);
$ss->setDescription((string)$node->Description);
$ss->setEmbedCode((string)$node->Embed); // changed
$ss->setNumViews((string)$node->Views);
View Api.java
public abstract class Api extends HttpServlet {
protected void responder(JSONObject resultado, HttpServletResponse response, String callback) {
try {
response.setContentType("text/javascript;charset=utf-8");
response.setHeader("Access-Control-Allow-Headers", "Content-Type, x-xsrf-token");
PrintWriter out = response.getWriter();
String saida = callback + "(" + resultado + ");";
out.print(saida);
} catch (IOException e) {
View questoes.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
questoes_disponiveis = [1, 2, 3, 4, 5, 6, 7, 8, 9]
questoes_escolhidas = []
i = 0
while i < 5:
rand = random.randrange(len(questoes_disponiveis))
View printme.py
import os
if __name__ == '__main__':
os.system("cat %s" % os.path.abspath(__file__))
exit(0)
print "hello world."