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
#!/bin/bash | |
# This script, named generate-pr-report.sh, generates a Markdown report of pull requests for specified GitHub users and date ranges within a GitHub project. | |
# It must be executed within the root directory of the project you want to analyze. | |
# | |
# Usage: | |
# ./generate-pr-report.sh "user1,user2" "2024-02,2024-03" | |
# This command generates a report for pull requests created by user1 and user2 between February 2024 and March 2024. | |
# | |
# ./generate-pr-report.sh "user1" |
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
(function () { | |
const selectorToFloat = (selector) => parseFloat(document.querySelector(selector).textContent.trim().replace(',', '.')); | |
const floatToLocaleString = (number) => number.toLocaleString('es-UY', { minimumFractionDigits: 2, maximumFractionDigits: 2 }); | |
const dolares = prompt('¿Cuántos dólares desea comprar?'); | |
const compra = selectorToFloat('table > tbody > tr:nth-child(2) > td:nth-child(3)'); | |
const venta = selectorToFloat('table > tbody > tr:nth-child(2) > td:nth-child(5)'); | |
const media = parseFloat(((compra + venta) / 2).toFixed(2)); | |
const pesos = parseFloat((dolares * media).toFixed(2)); |
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
document.write('<link rel="stylesheet" href="https://github.githubassets.com/assets/gist-embed-39872b2714d6.css">') | |
document.write('<div id=\"gist116784020\" class=\"gist\">\n <div class=\"gist-file\" translate=\"no\">\n <div class=\"gist-data\">\n <div class=\"js-gist-file-update-container js-task-list-container file-box\">\n <div id=\"file-zendesk-form-builder-js\" class=\"file my-2\">\n \n <div itemprop=\"text\" class=\"Box-body p-0 blob-wrapper data type-javascript \">\n\n \n<div class=\"js-check-bidi js-blob-code-container blob-code-content\">\n\n <template class=\"js-file-alert-template\">\n <div data-view-component=\"true\" class=\"flash flash-warn flash-full d-flex flex-items-center\">\n <svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n <path fill-rule=\"evenodd\" d=\"M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1. |
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
document.addEventListener('DOMContentLoaded', function() { | |
console.log('loading zendesk form builder'); | |
let REPORT_BUG_ARTICLE_ID = '6509556532759'; | |
let REPORT_BUG_TICKET_ID = '6504444995991'; | |
let CONTACT_US_ARTICLE_ID = '6510266315671'; | |
let CONTACT_US_TICKET_ID = '5754824917015'; | |
let FORM_PARENT_ID = 'request-form'; |
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
# src/api/auth/passport/jwt.strategy.ts | |
import { ExtractJwt, Strategy } from 'passport-jwt'; | |
import { PassportStrategy } from '@nestjs/passport'; | |
import { Injectable } from '@nestjs/common'; | |
import { ConfigService } from 'src/api/config/config.service'; | |
import { UsersProvider } from 'src/api/users/users.provider'; | |
import { JwtService } from '@nestjs/jwt'; | |
@Injectable() |
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
// index.html | |
// embed code | |
<script type="text/javascript" id="hs-script-loader" async defer src="//online-script.com/script-loader/XXXX.js"></script> | |
// online-script.com/script-loader/XXXX.js | |
(function (id, src) { | |
if (document.getElementById(id)) { return; } | |
var js = document.createElement('script'); | |
js.src = src; | |
js.type = 'text/javascript'; |
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
defmodule CryptoSystem do | |
def encrypt(text, key_seed) do | |
words = String.split(text, " "); | |
words | |
|> Enum.with_index() | |
|> Enum.map(&encrypt_word(&1, key_seed)) | |
|> Enum.join(" ") | |
end |
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
@weapons ~w(rock scissors paper)a | |
def rps(user_choice) when is_binary(user_choice), do: is_valid_choice(String.to_atom(user_choice)) | |
def rps(user_choice) when is_atom(user_choice), do: is_valid_choice(user_choice) | |
def rps(user_choice), do: {:lost, "Invalid type!"} | |
defp is_valid_choice(user_choice) when user_choice in @weapons, do: time_to_play(user_choice) | |
defp is_valid_choice(user_choice), do: {:lost, "Invalid choice!"} | |
defp time_to_play(user_choice) do |
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 knex; | |
/** | |
* This module extends the knex query builder with selectDistance method, | |
* The method adds a virtual column to the current query (qb) with the alias as, in which | |
* resides the calculated distance from the geoPoint to the entity.location column. | |
* It also accepts some options parameters like the unit (km | mi) and the decimalPrecision of the result. | |
* Deps: Postgis | |
* @example |
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
/** | |
* All the hours in a day in 12-hour clock format with a defined inverval | |
* | |
* @example | |
* // returns [ | |
* '12:00 AM', | |
* '12:15 AM', | |
* '12:30 AM', | |
* '12:45 AM', | |
* '01:00 AM', |