Here we, here we, here we fucking go
This file contains hidden or 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
| anonical(linked_timezone) do | |
| case do | |
| "Africa/Accra" -> "Africa/Abidjan" | |
| "Africa/Addis_Ababa" -> "Africa/Nairobi" | |
| "Africa/Asmara" -> "Africa/Nairobi" | |
| "Africa/Asmera" -> "Africa/Nairobi" | |
| "Africa/Bamako" -> "Africa/Abidjan" | |
| "Africa/Bangui" -> "Africa/Lagos" | |
| "Africa/Banjul" -> "Africa/Abidjan" | |
| "Africa/Blantyre" -> "Africa/Maputo" |
This file contains hidden or 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
| let Hooks = {} | |
| Hooks.ScrollableList = { | |
| updated() { | |
| this.el.querySelectorAll("li").forEach((option) => { | |
| option.addEventListener("focus", e => { | |
| e.target.scrollIntoView(); | |
| } | |
| }) | |
| } | |
| } |
This file contains hidden or 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
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | |
| // @ts-nocheck | |
| import { html as toReactNode } from 'satori-html'; | |
| import { Resvg } from '@resvg/resvg-js'; | |
| import DMSans from '$lib/fonts/DMSans-Bold.ttf'; | |
| import OpenGraph from '$lib/components/OpenGraph.svelte'; | |
| import satori from 'satori'; | |
| const height = 630; |
This file contains hidden or 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
| <script> | |
| let results = []; | |
| $: console.log({ results }); | |
| </script> | |
| {#if results.length > 0} | |
| <Results {results} /> | |
| {:else} | |
| <Search {results} /> |
This file contains hidden or 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
| /* eslint-disable prefer-const */ | |
| import { useEffect, useState } from 'react'; | |
| export default function useForm(initial = {}) { | |
| // create a state object for our inputs | |
| const [inputs, setInputs] = useState(initial); | |
| const initialValues = Object.values(initial).join(' '); | |
| useEffect(() => { | |
| setInputs(initial); |
This file contains hidden or 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
| <% content_for :head do %> | |
| <script src="https://js.stripe.com/v3/"></script> | |
| <script type="text/javascript"> | |
| const setupStripe = () => { | |
| const stripe = Stripe('pk_test_3rCk8Ewa2UTc79iWJZDCeKmH00plww4RXx'); | |
| document | |
| .getElementById("checkout") | |
| .addEventListener('click', (event) => { |
This file contains hidden or 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
| Testing |
This file contains hidden or 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 Politics.Seeder.Countries do | |
| alias Politics.Governments | |
| def populate do | |
| url = "https://raw.githubusercontent.com/everypolitician/everypolitician-data/master/countries.json" | |
| %{body: data} = url |> HTTPoison.get! | |
| {:ok, json} = JSON.decode(data) |
This file contains hidden or 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
| # I have an list of maps : | |
| sentence_list = [ | |
| %{ | |
| keywords: ~w(cat), | |
| sentence: "I'm a cat person", | |
| }, | |
| %{ | |
| keywords: ~w(dog), | |
| sentence: "I'm a dog person", |
NewerOlder