Skip to content

Instantly share code, notes, and snippets.

View condef5's full-sized avatar
🏠
Working from home

Frank Condezo condef5

🏠
Working from home
View GitHub Profile
@condef5
condef5 / fibonacci.cpp
Last active August 12, 2017 20:15
Serie de snipets para alumnos del 1 ciclo de la Unas
#include <iostream.h>
#include <conio.h>
void main(void)
{
// Serie de tipo => -1 1 0 1 1 2 3 5
int a =-1 ,b = 1, c, numTer;
cout<<"Ingrese el numero de terminos";
cin>>numTer;
for(int i = 0; i < numTer; i++){
c = a + b;
#include <iostream.h>
#include <conio.h>
/*Problema
Un programa que encuentre el segundo mayor en N numeros ingresados por teclado,
los nuemros ingresados deben estar comprendidos entre 10 y 99
*/
void main(void)
{
int minNum=10,maxNum=99,numTer,num, mayNum=0, mayTwoNum=0;
cout<<"Ingrese el numero de terminos";
#include <iostream.h>
#include <conio.h>
void main(void)
/*Problema: el gerente de un concesionario de una marca de automoviles desea conocer las estadisticas de autos vendidos por cada modelo que dispone. si se sabe que tiene 05 modelos y que inicio su trabajo en el año X ingresado por teclado. se desea desarrollar un programa que, dado las cantidades vendidas por cada año hasta el presente año, calcule el año que vendio mas autos, el año que vendio menos y el promedio de autos vendidos por cada modelo hasta el año actual
*/
{
//
int anioIni,anio_actual=2017;
int cantAutVen, sumNumAut=0, may=0, anioMay, men=0, anioMen;
float prom;
@condef5
condef5 / primos-repetidos.cpp
Created August 23, 2017 23:40
Primos repetidos en un array
#include "iostream.h"
#include "conio.h"
/*
Un programa que elimine los numeros primos que se repiten en un vector de N elementos
*/
void main(void)
{
// Variables para los primos
int numPri = 1 ,cantDiv=0;
// Vector
@condef5
condef5 / Dockerfile
Created December 16, 2017 01:55
Tiis - Cuarto Entregable
# Image from node
FROM node:7
# Global install yarn package manager
RUN apt-get update && apt-get install -y curl apt-transport-https && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && apt-get install -y yarn
# Install Nginx
@condef5
condef5 / visual-code.json
Created April 25, 2018 13:25
Editors config
{
"workbench.iconTheme": "vscode-great-icons",
"workbench.colorTheme": "Mirage",
"editor.fontFamily": "Fira Code, Roboto Mono, monospace",
"editor.lineHeight": 30,
"terminal.integrated.shell.windows": "C:\\WINDOWS\\sysnative\\cmd.exe",
"terminal.integrated.shellArgs.windows": [
"/K",
"%CMDER_ROOT%/vendor/init.bat"
],
@condef5
condef5 / function.js
Last active June 4, 2018 15:45
Function Path for crehana 🗼
const getIn = (obj, path, defaultValue) => {
var _path = path.split('.');
var _obj = Object.assign({}, obj);
var head;
while(typeof _obj == 'object' && _path.length > 0) {
[head, ..._path] = _path;
_obj = _obj[head];
}
return _obj || defaultValue;
@condef5
condef5 / Quotes.json
Last active August 14, 2018 05:40
FreeCodeCamp projects
{
"quotes": [
{
"text": "Levántate y camina hacia adelante, tienes las piernas para hacerlo. ",
"author": "Edward Elric",
"anime": "FMA"
},
{
"text": "No vivas con falsedades ni miedos, porque terminarás odiándote a ti mismo.",
"author": "Uzumaki Naruto",
@condef5
condef5 / mergeSort.js
Last active September 10, 2018 19:57
Algorithms of sorting methods
function mergeSort(array) {
if (array.length > 2) {
let half = parseInt(array.length/2);
let [left, rigth] = [mergeSort(array.slice(0, half)), mergeSort(array.slice(half))];
let ret = [];
for (let i = 0; i < array.length;i++) {
if (left.length <= 0 || (rigth.length > 0 && left[0] > rigth[0]))
ret.push(rigth.shift());
else
ret.push(left.shift());
@condef5
condef5 / dartList.dart
Last active October 30, 2018 23:15
Dart and Flutter basics.
void main() {
var deck = new Deck();
deck.removeCard('Diamons', 'Ace');
print(deck);
}
class Deck {
List<Card> cards = [];