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
#!/usr/bin/python | |
import time | |
from phue import Bridge | |
class LightColor: | |
def __init__(self, name, xy): | |
self.name = name | |
self.xy = xy |
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 | |
# | |
# 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 |
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
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); |
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 * 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"); |
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
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) { |