Skip to content

Instantly share code, notes, and snippets.

View xergioalex's full-sized avatar
🎯
Focusing

Sergio Florez xergioalex

🎯
Focusing
View GitHub Profile
Utils = {
// Detect if support local storage
supports_html5_storage: function () {
try {
localStorage.setItem('testKey', 'test');
localStorage.removeItem('testKey');
return true;
} catch (e) {
return false;
}
Utils = {
// Shuffle array
shuffle: function (o) {
for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
return o;
},
// Get random number in range
getRandomInt: function (min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
},
/*
* Validation Function
*/
ValidationContactForm = {
clear: function () {
Validations.clear(['name', 'email', 'subject', 'message']);
Validations.clear(['contactFormSuccess'], true);
},
setError: function (inputError, message) {
return Session.set(inputError, message);
@xergioalex
xergioalex / .block
Created August 11, 2018 00:45
fresh block
license: mit
@xergioalex
xergioalex / .block
Created August 11, 2018 20:06
D3 Force Simulation
license: mit
@xergioalex
xergioalex / .block
Created August 11, 2018 20:17
D3 Force Simulation
license: mit
@xergioalex
xergioalex / .block
Created August 11, 2018 20:32
D3 Force Simulation
license: mit
@xergioalex
xergioalex / .block
Created August 11, 2018 21:02
D3 Force Simulation
license: mit
@xergioalex
xergioalex / .block
Created August 11, 2018 21:31
D3 Force Simulation
license: mit
@xergioalex
xergioalex / Code with html
Last active August 20, 2018 21:13
Html markdown parser
module.exports = {
<details><summary>[mode](/concepts/mode): "production", // "production" | "development" | "none"</summary>
[mode](/concepts/mode): "production", // enable many optimizations for production builds
[mode](/concepts/mode): "development", // enabled useful tools for development
[mode](/concepts/mode): "none", // no defaults
</details>
// Chosen mode tells webpack to use its built-in optimizations accordingly.
<details><summary>[entry](/configuration/entry-context#entry): "./app/entry", // string | object | array</summary>
[entry](/configuration/entry-context#entry): ["./app/entry1", "./app/entry2"],
[entry](/configuration/entry-context#entry): {