Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View elxris's full-sized avatar

Christian Ceciliano elxris

  • Globant
  • Ciudad de México, México
  • 04:33 (UTC -06:00)
View GitHub Profile
@elxris
elxris / Readme.md
Created March 1, 2023 19:43
How to use a Raspberry PI Zero 2 as WIFI USB for Anycubic Photon Ultra

March 1, 2023: This is a draft, I plan to extend this guide.

How to use a Raspberry PI Zero as WIFI USB for Anycubic Photon

I have only tested this in a Raspberry PI Zero 2 with an Anycubic Photon Ultra and works fine. This setup allows to connect remotely to your Raspberry PI to upload some files and then just go to your printer and hit print. This is not intented to act as a remote orchestrator for your printer. It is just a commodity because I hated to move the usb.

Install Raspberry PI OS

Using the Raspberry PI Imager install Raspberry Pi OS on a microSD card.

@elxris
elxris / keybase.md
Created July 26, 2018 22:21
keybase.md

Keybase proof

I hereby claim:

  • I am elxris on github.
  • I am elxris (https://keybase.io/elxris) on keybase.
  • I have a public key ASA_iXDC93n7VbqGXBV9I27VE8prePmnuQkDIK4nx0uBIgo

To claim this, I am signing this object:

@elxris
elxris / index.js
Created May 30, 2016 19:21
lwip - Image Resize
var lwip = require('lwip');
lwip.open('image.jpg', function(err, image) {
if (err) {throw err;}
image.batch()
.cover(200, 200)
.writeFile('output.jpg', function(err) {
if (err) {throw err;}
});
});
<!DOCTYPE html>
<html>
<head>
<!--Import Google Icon Font-->
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/css/materialize.min.css">
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
@elxris
elxris / CHALLENGE.md
Last active February 12, 2016 15:34
Codefight NewYear Challenge

Challenge Url

After finishing your last CodeFight of 2015 you suddenly realize: the New Year is almost here! To share your excitement, you want to send a New Year's wishp to the community.

You think your message should look nice, so you decide to put it into a frame of asterisks ('*'), with each word on a separate line.

Write a function that returns a framed wish as an array of strings, where each string is a word of the wish (including any punctuation marks that might come right after it) with some spaces added to make the frame rectangular. Note that there should be exactly 1 whitespace character (' ') before each word, and at least 1 after.

Example

@elxris
elxris / gist:25244fabc6c65851ecbf
Last active August 29, 2015 14:21
Sieve of Eratosthenes
var input = process.env.INPUT || 2;
var sieve = function(upperBound) {
var boolArray = new ArrayBuffer(upperBound);
var i, j;
for (i = 2; i < (Math.sqrt(upperBound))|0; i++) {
if (boolArray[i] === 0) {
for (j = 0; (i*2 + j*i) < upperBound; j++) {
boolArray[(i*2 + j*i)] = 1;
}
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var UserSchema = new Schema({
username: {type: String, trim: true},
data: {
color: {type: Number}
}
});
@elxris
elxris / MyClass.js
Last active August 29, 2015 14:15
POO in JS
function MyClass (var1, var2) { // Constructor function
var privateVariable = 'foo'; // Private variable instanced
this.publicVariable = 'bar'; // Public variable instanced
this.privilegedMethod = function () {
return privateVariable; // It's privileged 'cause it can access private variable
};
}
// Only keept once on memory, available in all instance
MyClass.prototype.publicMethod = function () {
return this.privilegedMethod();
@elxris
elxris / gist:d4391810dfbaa6a74bc7
Created September 23, 2014 16:31
Commit Specification
[^]Bugfix [!]Updated [+]Feature [-]Removed