Skip to content

Instantly share code, notes, and snippets.

View xergioalex's full-sized avatar
🎯
Focusing

Sergio Florez xergioalex

🎯
Focusing
View GitHub Profile
@xergioalex
xergioalex / main.py
Created May 16, 2019 17:09
Create lists of days between two days in python
from datetime import datetime
from datetime import timedelta
start = '6/29/19'
end = '6/20/20'
start_date = datetime.strptime(start, '%m/%d/%y')
end_date = datetime.strptime(end, '%m/%d/%y')
days_total = (end_date - start_date).days
@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): {
@xergioalex
xergioalex / .block
Created August 11, 2018 21:31
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 20:32
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:06
D3 Force Simulation
license: mit
@xergioalex
xergioalex / .block
Created August 11, 2018 00:45
fresh block
license: mit
/*
* Validation Function
*/
ValidationContactForm = {
clear: function () {
Validations.clear(['name', 'email', 'subject', 'message']);
Validations.clear(['contactFormSuccess'], true);
},
setError: function (inputError, message) {
return Session.set(inputError, message);
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;
},