Skip to content

Instantly share code, notes, and snippets.

View ayxos's full-sized avatar
🎯
Focusing

marco ayxos

🎯
Focusing
View GitHub Profile
@ayxos
ayxos / Raspbian light
Last active May 13, 2020 09:44
If you use your Rpi as a server via ssh w/o UI, you can get additional space with the following commands
# https://www.howtogeek.com/169679/how-to-add-a-printer-to-your-raspberry-pi-or-other-linux-computer/
# Lite version
sudo raspi-config
sudo apt-get update
sudo apt-get upgrade
sudo apt install -y python3-pip libffi-dev hplip cups nginx nodejs samba vim htop
sudo usermod -a -G lpadmin pi
sudo /etc/init.d/nginx start
curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh
@ayxos
ayxos / LoginForm.spec.js
Created October 4, 2018 08:41
Basic React test with enzyme/jest
import React from 'react';
import { mount } from 'enzyme';
import LoginForm from 'components/LoginForm';
const credentials = { username: 'a@test.com', password: 'testpass' };
const test = jest.fn();
function setup() {
// Modal fix
const div = document.createElement('div');
@ayxos
ayxos / gist:94026b4487c1353211c59ba73e86964b
Created December 1, 2016 14:54
Testing Performance Comparing Object, If-Else and Switch on Chrome
var dimensionSize = {
mma: { width: 300, height: 50 },
medrect: { width: 300, height: 250 },
xxlarge: { width: 320, height: 50 },
xlarge: { width: 300, height: 50 },
sky: { width: 120, height: 600 },
widesky: { width: 160, height: 600 },
leader: { width: 728, height: 90 },
full_320x480: { width: 320, height: 480 },
full_480x320: { width: 480, height: 320 },
/*global $, Backbone, window, console, WebSocket, _ */
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var $content = $('#content')
, $input = $('#input')
, $status = $('#status')
// my color assigned by the server
function contains(arr, element) {
var i = arr.length;
var elementToInt = parseInt(element, 10);
while (i--) {
if ( arr[i] === elementToInt) {
return true;
}
}
return false;
}
@import url("http://fonts.googleapis.com/css?family=Lato:100,300,400,700");
html,
body,
div,
span,
object,
iframe,
h1,
h2,
h3,
@ayxos
ayxos / main.js
Last active August 29, 2015 13:56
$(document).ready(function(){
$('input#update').click(function() {
var clave = $('#keys').val();
var valor = $('#value').val();
var arr = {};
arr[clave] = valor;
console.log(arr);
doctype html
html(lang='es')
head
meta(charset='utf-8')
meta(name='description', content='APIRest_test')
meta(name='keywords', content='API, rest, node, mongo, mongoose, html5, express')
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
script(type="text/javascript", src="http://code.jquery.com/jquery-1.11.0.min.js")
extends layout
block content
article
div.addCommentForm
form( method="post", action="/api/entries")
div
div
span.label Name :
input(name="name")
@ayxos
ayxos / app.js
Last active August 29, 2015 13:56
require( './routes/model_db' );
var express = require('express');
var routes = require('./routes');
var http = require('http');
var path = require('path');
var app = express();