Skip to content

Instantly share code, notes, and snippets.

View joepreludian's full-sized avatar
🛰️
Working from home

Jonhnatha Trigueiro joepreludian

🛰️
Working from home
  • Loka
  • Joao Pessoa PB
  • 23:13 (UTC -03:00)
View GitHub Profile
@joepreludian
joepreludian / desafio1.md
Created August 27, 2014 18:59
Desafio para desenvolvimento #1

Desafio para desenvolvimento #1

Esse aplicativo visa a construção de uma simples lista de tarefas. Ela testará seus skills em javascript, assim como organização do código, versionamento e, mais importante, sua organização.

###Como a aplicação deveria se comportar? Crie, apenas no browser, um programa para colocar uma lista de tarefas. A lista de tarefas funcionará da seguinte forma:

  • Terá uma botão onde você pode adicionar uma nova nota e apagar notas selecionadas, este último desabilitado por padrão;
  • Na nota que será criada, ao ser apertado a tecla "Enter" o sistema salva essa nota e dá a oportunidade para criar outra nota, dando o foco para a nova nova;
@joepreludian
joepreludian / 0_reuse_code.js
Created July 29, 2014 18:35
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@joepreludian
joepreludian / view_preco_programa.sql
Last active August 29, 2015 14:02
Sql do aplicativo LUPANAR, desenvolvido em sala de aula para demonstracao da disciplina de banco de dados.
SELECT
t1.codprog,
t1.entradaprog,
t2.nomesuite,
coalesce((select
sum(t3.precoputa)
from
puta t3
where
t3.codputa in (
@joepreludian
joepreludian / select_rank.sql
Last active August 29, 2015 14:02
Exemplo de uma sql usando variáveis e Ranking
SET @rank = 0;
SELECT
*
FROM
(
SELECT
@rank :=@rank + 1 AS ranking,
id as chamado,
nome,
@joepreludian
joepreludian / history.py
Created February 12, 2014 02:34
History File patched to avoid unicodewarning. Enjoy!
#!/usr/bin/python -t
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
@joepreludian
joepreludian / fabfile.py
Last active July 23, 2016 16:38
Simple Fabfile for django based apps deployment
# -*- encoding: utf8 -*-
from fabric.api import env, settings, cd
from fabric.contrib.files import exists
from fabric.operations import local, sudo, run, put
import os
# Default configurations
env.hosts = ['[email protected]']
@joepreludian
joepreludian / fabfile.py
Created December 13, 2013 17:35 — forked from fiee/fabfile.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
fabfile for Django
------------------
see http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p/
modified for fabric 0.9/1.0 by Hraban (fiëé visuëlle)
several additions, corrections and customizations, too
@joepreludian
joepreludian / intervalo.cpp
Created December 11, 2013 13:32
Segundo exercício da lista de exercícios da professora Eliselma.
//
// 1) Intervalos
//
// Lê um número não conhecido de valores, um de cada vez, e conta quantos deles estão em cada um dos intervalos
// [0; 25), [25; 50), [50; 75) e [75; 100]
//
#include <iostream>
using namespace std;
@joepreludian
joepreludian / negativo.cpp
Created December 11, 2013 12:55
Primeira questão de Eliselma - Trabalho.
//
// 1) Negativo
//
// Lê 5 valores inteiros, um de cada vez, conta quantos destes valores são negativos e imprime esta informação.
//
#include <iostream>
using namespace std;
int main(int argc, const char * argv[])
@joepreludian
joepreludian / terminal_scroller.js
Created December 9, 2013 18:11
Script para atuar como um scroller estilo terminal do linux. basta jogar o seguinte código. Chega na div que quer que scroll funcione e adicione 'terminal' na propriedade 'class'; crie um checkbox e coloque nele a tag 'data-scroller' com o valor igual ao id da div que você elegeu para ser o scroller. Este checkbox habilitará/desabilitará o modo …
$("div[class~=terminal]").on('DOMNodeInserted', function(){
var current_scroll = this.scrollHeight;
var element_height = $(this).height();
var this_element_id = $(this).attr('id');
var is_allowed_to_scroll = $('input[data-scroller='+ this_element_id +']:checked',0).length;
if (is_allowed_to_scroll)
if (current_scroll > element_height)
this.scrollTop = current_scroll