Skip to content

Instantly share code, notes, and snippets.

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

Alexander J. Rodriguez D. AlexR1712

🏠
Working from home
View GitHub Profile
@AlexR1712
AlexR1712 / levenshtein.php
Created March 19, 2018 21:26
levenshtein. without native function
<?php
// Distancia Levenshtein en PHP (Sin usar la funciona nativa)
function lev($s,$t) {
$m = strlen($s);
$n = strlen($t);
for($i=0;$i<=$m;$i++) $d[$i][0] = $i;
for($j=0;$j<=$n;$j++) $d[0][$j] = $j;
@AlexR1712
AlexR1712 / README.md
Created February 12, 2018 20:44
Sequelize + Express + Migrations + Seed Starter
@AlexR1712
AlexR1712 / getElemClicked.js
Last active January 18, 2018 14:34
Get element clicked
document.addEventListener('click', function(e) {
e = e || window.event;
var target = e.target || e.srcElement,
text = target.textContent || text.innerText;
}, false);
// Version Two
if (document.addEventListener){
document.addEventListener("click", function(event){
var targetElement = event.target || event.srcElement;
@AlexR1712
AlexR1712 / printMousePos.js
Created January 18, 2018 14:27
print Mouse Position
function printMousePos(event) {
document.body.textContent =
"clientX: " + event.clientX +
" - clientY: " + event.clientY;
}
document.addEventListener("click", printMousePos);
@AlexR1712
AlexR1712 / .gitlab-ci.yml
Created December 13, 2017 15:20 — forked from aasanchez/.gitlab-ci.yml
Giltab
stages:
- test
- build
- deploy
test:
stage: test
script: echo "Running tests"
build:
@AlexR1712
AlexR1712 / image.php
Created October 23, 2017 14:03
gaussian blur in one sector of the image PHP
<?php
$loadFile = 'https://c1.staticflickr.com/5/4094/4809804115_40f52c8f25_b.jpg';
$image = imagecreatefromstring(file_get_contents($loadFile));
if ($image !== false) {
$face = imagecrop($image, ['x' => 152, 'y' => 568, 'width' => 199, 'height' => 199]);
@AlexR1712
AlexR1712 / 0x00000.bin
Created October 12, 2017 19:21 — forked from ajfisher/0x00000.bin
ESP8266 Transparent bridge to J5
@AlexR1712
AlexR1712 / tumblr.js
Created October 7, 2017 18:47
Tumblr Post type Text, thumbnails
/* Created by AlexR1712 */
function getImg (str) {
var m,
urls = [],
rex = /<img[^>]+src="(http:\/\/[^">]+)"/g;
while ( m = rex.exec( str ) ) {
urls.push( m[1] );
}
return urls;
}
@AlexR1712
AlexR1712 / developtome.js
Created October 7, 2017 13:48
developtome.js
!function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="./",e(e.s=0)}({"/6JT":function(t,e,n){t.exports=n.p+"assets/images/profil-03.jpg"},0:function(t,e,n){t.exports=n("JkW7")},"1/9l":function(t,e,n){(function(t){+function(t){"use strict";function e(e){return this.each(function(){var i=t(this),o=i.data("bs.tooltip"),r="object"==typeof e&&e;!o&&/destroy|hide/.test(e)||(o||i.data("bs.tooltip",o=new n(this,r)),"string"==typeof e&&o[e]())})}var n=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",t,e)};n.VERSION="3.3.7"
@AlexR1712
AlexR1712 / developtome.css
Last active October 7, 2017 13:44
developtome.css
@import url(https://fonts.googleapis.com/css?family=Hind+Siliguri:300,600|Martel:400,900);@import url(https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css);/*!
* Bootstrap v3.3.7 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;l