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
require 'socket'
module MyServer
@@routes = {
"/" => "Hello World!\n"
}
def response(socket, content)
socket.print "HTTP/1.1 200 OK\r\n" +
"Content-Type: text/plain\r\n" +
@condef5
condef5 / main.js
Last active May 20, 2019 05:21
Javascript - Initial
// go to about:blank
let animeList = [
{
id: 1,
name: 'Cowboy Bebop',
releaseDate: '03-04-1998'
},
{
id: 2,

Installfest

Follow these steps to make sure your computer is ready for the bootcamp:

  1. Update the system
$ sudo apt-get update
@condef5
condef5 / docker-compose.yml
Created February 10, 2019 16:59
Docker dotfiles
version: "3"
services:
admin:
image: condef5/admin-touch
container_name: admin
environment:
VIRTUAL_HOST: admin.touch-sound.net
restart: always
app:
@condef5
condef5 / directionsReduction.js
Created January 22, 2019 17:52
Codewars for ever
// solution initial
function dirReduc(arr) {
while (true) {
for (let i = 0; i < arr.length - 1; i++) {
if (
(arr[i] === 'NORTH' && arr[i + 1] === 'SOUTH') ||
(arr[i] === 'SOUTH' && arr[i + 1] === 'NORTH') ||
(arr[i] === 'EAST' && arr[i + 1] === 'WEST') ||
(arr[i] === 'WEST' && arr[i + 1] === 'EAST')
) {
// solution with functional programming
function validParentheses(cad) {
if (cad.length === 0) {
return true;
}
if (cad[0] === ')' || cad[cad.length - 1] === '(') {
return false;
@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 = [];
@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 / 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 / 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;