Skip to content

Instantly share code, notes, and snippets.

Átila Camurça Alves atilacamurca

Block or report user

Report or block atilacamurca

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
atilacamurca /
Created Apr 17, 2017 — forked from naholyr/
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.


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) {'show');
atilacamurca / SlideShare.php
Created Dec 1, 2014
zf1 - workaround for slideshare api 2.0 support in zf1 - just replace the method _slideShowNodeToObject
View SlideShare.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 service
* @return Zend_Service_SlideShare_SlideShow The resulting object
atilacamurca /
Created Jul 9, 2014
desafio 4 - script para gerar arquivo com letras trocadas.
#!/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":
atilacamurca / dica-02.hex
Last active Aug 29, 2015
View dica-02.hex

Baixe o projeto:

  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 ./ 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 :)
atilacamurca / SlideShare.php
Created Apr 3, 2014
Trecho referente a classe Zend_Service_SlideShare, houve mudanças na API e alguns nomes das tags do XML estão diferentes.
View SlideShare.php
protected function _slideShowNodeToObject(SimpleXMLElement $node)
if($node->getName() == 'Slideshow') {
$ss = new Zend_Service_SlideShare_SlideShow();
$ss->setEmbedCode((string)$node->Embed); // changed
atilacamurca /
Created Mar 10, 2014
Cross Site Access via JSONP
public abstract class Api extends HttpServlet {
protected void responder(JSONObject resultado, HttpServletResponse response, String callback) {
try {
response.setHeader("Access-Control-Allow-Headers", "Content-Type, x-xsrf-token");
PrintWriter out = response.getWriter();
String saida = callback + "(" + resultado + ");";
} catch (IOException e) {
atilacamurca /
Created Nov 26, 2013
algoritmo para escolha de 5 questões aleatórias
#!/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))
atilacamurca /
Created Apr 18, 2013
print the file itself
import os
if __name__ == '__main__':
os.system("cat %s" % os.path.abspath(__file__))
print "hello world."
You can’t perform that action at this time.