This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import timeit | |
from typing import List, Optional | |
import unittest | |
# simple binary search algrothim. requires a sorted list function | |
def binary_search(sorted_list: List[str], target: str) -> Optional[int]: | |
left, right = 0, len(sorted_list) - 1 | |
while left <= right: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tweepy | |
# You can get this credentials from your tweeter developer account | |
consumer_key = 'xxxxxxxxxxxxxxxxx' | |
consumer_secret = 'xxxxxxxxxxxxxxxxxxx' | |
key = 'xxxxxxxxxxxxxx-xxxxxxxxxxxxx' | |
secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Async function to replace words between brackets | |
* | |
* E.g. | |
* replaceBrackets( | |
* "Hey, {{ name }}. We just sent your authentication code to {{ email||phoneNumber }}", | |
* { | |
* name: "Jhon Doe", | |
* email: "[email protected]" | |
* } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Generate a random string with a given lenth | |
* | |
* @author <@thehomelessdev> | |
* @version 1.0.1 | |
* | |
* @example | |
* // returns ten random characters including numbers and special characters | |
* generateRandomString(10, { includeSpecialCharacters: true }) | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Require the module | |
const { parseMailTemplate } = require("./path/to/parseMailTemplate"); | |
// The params we need to pass | |
const html = '<html lang="es"><head><meta charset="utf-8"><title>Email Verification</title></head><body><h1>Hey, {{ name }}</h1><p>You have just created an account on <strong>{{ company }}</strong>. Please click the following <a href="{{ link }}" target="_blank">link</a> so you can start using your account.</p></body></html>'; | |
const data = { | |
name: "Jhon Doe", | |
company: "My awesome company", | |
link: "http://example.com, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var canvas = document.querySelector('canvas'); | |
// we need this to load the font | |
var myFont = new FontFace('myFont', 'url(assets/fonts/myFont/myFont.otf)'); | |
myFont.load().then(function(font){ | |
// with canvas, if this is ommited won't work | |
document.fonts.add(font); | |
console.log('Font loaded'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mixin modalForm(params) | |
//- Subscribe Form Moda | |
.modal.fade(id=params.modalId, tabindex="-1", role="dialog", aria-labelledby=params.modalId, aria-hidden="true") | |
.modal-dialog.modal-dialog-centered(role="document") | |
.modal-content | |
//- Form | |
form(id=params.form.id, action=params.form.action, method="POST", data-submit=params.form.attrData.submit, data-disable-submition-btn=params.form.attrData.disableSubmitBtn, data-message=params.form.attrData.message) | |
//- Modal Header | |
.modal-header | |
h5.modal-title(id="subscribeFormModalLongTitle") Recibe nuestras notificaciones |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="es" class="no-js"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Mi página Web</title> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<article class="post"> | |
<header> | |
<h1 class="post-title">But Will It Make You Happy?</h1> | |
<time class="post-updated" datetime="2017-03-14 21:36:03-0400" pubdate>03-14-2017</time> | |
<p class="post-author"> | |
By <span class="fn">Santiago Rincón</span> | |
</p> | |
</header> | |
<div class="post-content"> |
NewerOlder