Skip to content

Instantly share code, notes, and snippets.

@ronanyeah
ronanyeah / index.css
Created September 23, 2021 01:14
motion.dev shadow css
background-color: transparent;
background-image: radial-gradient(transparent 1px,black 1px);
background-size: 5px 5px;
opacity: 0.9;
background-position: 100% 100%;
transform: translate(5px, 5px);
@ronanyeah
ronanyeah / main.rs
Created April 4, 2020 07:36
TMDb scrape
use std::fs::File;
use std::io::prelude::*;
use std::io::BufReader;
const API_KEY: &str = "☘️";
#[derive(serde::Deserialize)]
struct Res {
results: Vec<MovieDb>,
}
@ronanyeah
ronanyeah / main.rs
Created April 4, 2020 03:02
YouTube free movies scraper
use scraper::{Html, Selector};
use std::fs::File;
use std::io::prelude::*;
const USER_AGENT: &str = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36";
const URL: &str = "https://www.youtube.com/feed/storefront?bp=kgEmCGQSIlBMSFBUeFR4dEMwaWJWWnJUMl9XS1dVbDJTQXhzS3VLd3iiBQIoAg%3D%3D";
#[derive(serde::Deserialize, serde::Serialize)]
struct Movie {
@ronanyeah
ronanyeah / Main.elm
Last active October 7, 2020 01:53
Netlify email capture
send : Cmd Msg
send =
Http.post
{ url = "/subscribers"
, body =
[ ( "email", JE.string "foo@bar.com" ) ]
|> JE.object
|> Http.jsonBody
, expect = Http.expectWhatever EmailCb
}
module Gif exposing (main)
import Browser exposing (Document, UrlRequest)
import Browser.Navigation exposing (Key)
import Dict exposing (Dict)
import Element exposing (Attribute, Color, Element, centerX, centerY, column, el, fill, fillPortion, height, html, layout, maximum, none, padding, paragraph, px, rgb255, shrink, spacing, text, width, wrappedRow)
import Element.Background as Background
import Element.Border as Border
import Element.Font as Font
import Element.Input as Input exposing (button)
module Main exposing (main)
import Browser
import Html exposing (Html, button, div, input, pre, text)
import Html.Attributes exposing (type_, value)
import Html.Events exposing (onClick, onInput)
import Http
import Json.Decode as JD exposing (Decoder)
import Json.Encode as JE exposing (Value)
import Task exposing (Task)
module Email.Invitation.View exposing (view)
import Html exposing (..)
import Html.Attributes exposing (..)
import Mjml exposing (..)
import Email.UI.Base as Base
import Email.UI.Card as Card
import Email.UI.Style as Style
@ronanyeah
ronanyeah / yay.sh
Last active September 9, 2019 22:23
# https://aur.archlinux.org/packages/yay/
# upgrade all packages
yay -Syu --combinedupgrade
# search for a package
yay foo
# remove a package and all subsequent unneeded dependencies
yay -Rs foo
@ronanyeah
ronanyeah / None.elm
Created September 4, 2019 03:12
Attr none
none : Element.Attribute msg
none =
Html.Attributes.classList [] |> Element.htmlAttribute
const { publicKey, privateKey } = await crypto.generateKey(
{
name: "RSA-OAEP",
modulusLength: 2048,
publicExponent: new Uint8Array([0x01, 0x00, 0x01]),
hash: "SHA-256"
},
true,
["encrypt", "decrypt"]
);