Skip to content

Instantly share code, notes, and snippets.

View rsurjano's full-sized avatar
:octocat:
Business & Code!

Roy Carlos rsurjano

:octocat:
Business & Code!
View GitHub Profile
@rsurjano
rsurjano / get-absolute-url.js
Last active September 3, 2016 15:58
Web Utils
var getAbsoluteUrl = (function() {
var a;
return function(url) {
if(!a) a = document.createElement('a');
a.href = url;
return a.href;
};
})();
@rsurjano
rsurjano / sha1.js
Created August 18, 2016 16:56
Crypt Utils
/**
* SHA-1 cryptographic hash constructor.
*
* The properties declared here are discussed in the above algorithm document.
* @constructor
*/
Sha1 = function() {
/**
@rsurjano
rsurjano / clone-object.js
Last active September 12, 2018 15:24
Object Utils
'use strict';
function clone(item) {
if (!item) {
return item;
}
// null, undefined values check
var types = [Number, String, Boolean],
result;
@rsurjano
rsurjano / loop-any-times.js
Last active September 12, 2018 15:24
Array Utils
// 1. Basic for loop.
for(var i = 0; i < 5; i++) {
// ....
}
// 2. Using Array's join and split methods
Array.apply(null, Array(5)).forEach(function(){
// ...
});
@rsurjano
rsurjano / Detect IE
Last active September 12, 2018 14:16
Ie Browser Detection javascript code snippet
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@rsurjano
rsurjano / string2dom
Last active September 12, 2018 15:24
creates a html content using a provided string
ar str2DOMElement = function(html) {
var wrapMap = {
option: [ 1, "<select multiple='multiple'>", "</select>" ],
legend: [ 1, "<fieldset>", "</fieldset>" ],
area: [ 1, "<map>", "</map>" ],
param: [ 1, "<object>", "</object>" ],
thead: [ 1, "<table>", "</table>" ],
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
@rsurjano
rsurjano / gist:042ccdcaec9bd1383cb6773d82441609
Created June 11, 2019 13:37
Flutter development agencies
pyramidions
https://www.pyramidions.com/flutter-app-development
intelivita
https://www.intelivita.co.uk/flutter-application-development.php
appinventiv
https://appinventiv.com/flutter-app-development
citrusleaf
@rsurjano
rsurjano / .npmrc
Last active December 9, 2019 14:00
Verdaccio Script for caching npm packages
registry=http://localhost:4873
@rsurjano
rsurjano / settings.json
Created December 11, 2019 18:35
vscode-editor
{
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": false
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
# Improve your code commenting by annotating with alert, informational, TODOs, and more!
code --install-extension aaron-bond.better-comments
# formateador de css
code --install-extension aeschli.vscode-css-formatter
# recomendado!! crea breakpoints navegables en el codigo
code --install-extension alefragnani.Bookmarks
# para trabajar con plantillas handlebars
code --install-extension andrejunges.Handlebars
# temas muy buenos para vscode
code --install-extension AndrsDC.base16-themes