Skip to content

Instantly share code, notes, and snippets.

View dejuata's full-sized avatar
:octocat:
Frontend Developer

Juan Pino dejuata

:octocat:
Frontend Developer
View GitHub Profile
@karlosgliberal
karlosgliberal / gist:901812
Created April 4, 2011 15:21
Conectando nodejs a arduino mediante el puerto serie
//Ejemplo sencillo para poder manejar un motor servo conectado aun ardunio desde nodejs
//app.js fichero principal tipo express
var express = require('express');
//npm install serialport
//https://github.com/voodootikigod/node-serialport
var serialport = require("serialport");
var SerialPort = serialport.SerialPort; // localize object constructor
var app = module.exports = express.createServer();
@iizukak
iizukak / gram_schmidt.py
Created October 14, 2011 18:18
Gram-Schmidt Orthogonization using Numpy
import numpy as np
def gs_cofficient(v1, v2):
return np.dot(v2, v1) / np.dot(v1, v1)
def multiply(cofficient, v):
return map((lambda x : x * cofficient), v)
def proj(v1, v2):
return multiply(gs_cofficient(v1, v2) , v1)
@num3ric
num3ric / gaussian_elim.py
Created November 11, 2011 05:56
Gaussian elimination using NumPy.
import numpy as np
def GENP(A, b):
'''
Gaussian elimination with no pivoting.
% input: A is an n x n nonsingular matrix
% b is an n x 1 vector
% output: x is the solution of Ax=b.
% post-condition: A and b have been modified.
'''
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@robgolding
robgolding / filtering.py
Created November 17, 2012 16:44
Django Class-Based View Mixins: Part 2
class FilterMixin(object):
"""
View mixin which provides filtering for ListView.
"""
filter_url_kwarg = 'filter'
default_filter_param = None
def get_default_filter_param(self):
if self.default_filter_param is None:
raise ImproperlyConfigured(
@wyudong
wyudong / rgb2cmyk.cpp
Last active January 23, 2024 14:35
OpenCV: From RGB to CMYK
// RGB to CMYK conversion
void rgb2cmyk(cv::Mat& img, std::vector<cv::Mat>& cmyk) {
// Allocate cmyk to store 4 componets
for (int i = 0; i < 4; i++) {
cmyk.push_back(cv::Mat(img.size(), CV_8UC1));
}
// Get rgb
std::vector<cv::Mat> rgb;
cv::split(img, rgb);
@kamikaze-lab
kamikaze-lab / readme.md
Created February 23, 2015 02:47
Guía de estilo para Python
@sgnl
sgnl / _notes.md
Last active August 26, 2022 03:03
AJAX with Vanilla Javascript. (XMLHttpRequest)

Short XHR Examples

Examples shown are bare minimum needed to achieve a simple goal.

Resources

  • Google Chrome's Dev Tools' Network Panel c-c-c-c-c-ULTIMATE c-c-c-COMBO!!!
  • requestb.in enpoints for your HTTP Requests as a free service.
@mxstbr
mxstbr / Readme.md
Last active June 25, 2024 18:16
Enable tab completion for JSX with Emmet in Atom

Enable tab completion for JSX with Emmet in Atom

This guide assumes you have the emmet and language-babel packages already installed in Atom

Gif of the tab completion working

  1. Open the keymap.cson file by clicking on Atom -> Keymap… in the menu bar
  2. Add these lines of code to your keymap:
'atom-text-editor[data-grammar~="jsx"]:not([mini])':
@Klerith
Klerith / instalaciones-angular-adv.md
Last active April 16, 2024 20:18
Instalaciones recomendadas para el curso Avanzado de Angular