Skip to content

Instantly share code, notes, and snippets.

View annthurium's full-sized avatar
🏳️‍🌈

Tilde Thurium annthurium

🏳️‍🌈
View GitHub Profile
@annthurium
annthurium / send-affirmation.ts
Created May 11, 2020 18:00
Send a text message with Twilio and Deno
import * as base64 from "https://denopkg.com/chiefbiiko/base64/mod.ts";
const getAffirmations = async (fileName: string): Promise<Array<string>> => {
const decoder = new TextDecoder("utf-8");
const text: string = decoder.decode(await Deno.readFile("affirmations.txt"));
return text.split("\n");
};
const affirmations: Array<string> = await getAffirmations("affirmations.txt");
@annthurium
annthurium / index.js
Created March 20, 2020 18:39
get the number of genderless pokemon from the poke api
const got = require("got");
(async () => {
try {
const response = await got("https://pokeapi.co/api/v2/gender/3/");
const pokemonSpecies = JSON.parse(response.body);
console.log(pokemonSpecies.pokemon_species_details.length);
} catch (error) {
console.log(error);
@annthurium
annthurium / nomorobo.js
Last active May 30, 2021 22:29
nomorobo.js
const client = require('twilio')(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN);
/**
* Detect whether a number is a robo caller.
*
* @param {string} phoneNumber - The number the call is coming from. in e.164 format
* @return {Promise<boolean>} true if the number belongs to a robocaller
*
*/
async function isRoboCaller(phoneNumber) {
@annthurium
annthurium / pre-commit
Last active March 7, 2019 00:06
pre commit hook shell script
#!/bin/bash
#
# author: @smashwilson
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
# It should live in .git/info/hooks/pre-commit
#!/usr/bin/python
import time
from phue import Bridge
class LightColor:
def __init__(self, name, xy):
self.name = name
self.xy = xy