Skip to content

Instantly share code, notes, and snippets.

View joffilyfe's full-sized avatar

Joffily joffilyfe

  • 02:00 (UTC +01:00)
View GitHub Profile
var volta = new Date("12/12/2015").getTime();
var ida = new Date().getTime();
if (volta < ida) {
alert("Voce não pode voltar no tempo")
} else {
alert("Muito bem criança");
}
@joffilyfe
joffilyfe / patch.py
Last active August 29, 2015 14:25
Patch para template do OJS e portal padrão
# -*- coding: utf-8 -*-
#!/usr/bin/python
import os
os.system('clear')
print('Clonando o repositorio..')
os.system('git clone https://github.com/joffilyfe/periodicos-ifpb.git')
print('Instalando os arquivos')
os.system('cp -r periodicos-ifpb/templates/portalpadrao ojs/templates')
def formatar(numeros):
maior = int(numeros[0])
meio = int(numeros[1])
paginas = int(numeros[2])
menor = min(numeros)
pagina = paginas
barra = []
# Incio
while pagina >= 1:
quantidade = int(input())
somas = []
def is_prime(numero):
for n in range(2, numero/2):
if numero % n == 0:
return False
return True
from collections import Counter
def to_dict(array):
temp = Counter(array)
return temp
def to_win(lista):
qtd = 0
numero = 1000
@joffilyfe
joffilyfe / recebe_serial.c
Created August 31, 2015 13:53
Recebendo comandos via porta serial no Arduino Mega
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial);
// send an intro:
Serial.println("\nSerial INPUT!");
}
void loop() {
// Read serial input:
@joffilyfe
joffilyfe / interface_arduino.py
Created August 31, 2015 13:54
Interface para enviar comandos ao Arduino com Python
from Tkinter import *
import base64
import serial
class Main:
def __init__(self, master):
self.frame = Frame(master)
self.frame.pack()
https://wiki.duraspace.org/display/DSPACE/Installing+DSpace+4.2+on+Ubuntu+Server+14.04.1+LTS#InstallingDSpace4.2onUbuntuServer14.04.1LTS-InstallPrerequisites
#include <iostream>
#include <vector>
#include <map>
#include <iomanip>
using namespace std;
int main(){
int np = 4; // quantidade de produtos
int cap = 5; // capacidade da mochila
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Prodeaf Translator</title>
<style>
.page-container {
width: 70%; margin: 50px auto;
}