Skip to content

Instantly share code, notes, and snippets.

View ViralTaco's full-sized avatar
🍋

Anthony Capobianco ViralTaco

🍋
View GitHub Profile
@ViralTaco
ViralTaco / space-age.hpp
Last active September 1, 2023 06:34
Solution to the Exercism.io "C++ Space Age" exercise.
#ifndef VT_SPACE_AGE_HPP
#define VT_SPACE_AGE_HPP
/// copyright 2019-2021 viraltaco_ <https://opensource.org/licenses/MIT>
namespace /*(anonymous)*/ {
namespace space_age::inline detail {
template <class T> struct [[nodiscard]] getter {
constexpr auto operator ()() const noexcept { return value; }
const T value;
};
@ViralTaco
ViralTaco / .zshrc
Last active January 31, 2020 11:35
zsh dotfiles
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/taco/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
function age(bdate) {
const dateNow = Date.now()
const birthday = new Date(bdate)
if (birthday > dateNow) {
return NaN
} else {
const difference = new Date(dateNow - birthday)
return difference.getFullYear() - 1970
}
@ViralTaco
ViralTaco / lastfm.php
Last active March 15, 2019 05:39 — forked from dewey/lastfm.php
Last.fm "now playing" script for Textual.Installation: Copy this script to ~/Library/Application Scripts/com.codeux.irc.textual/lastfm.php Usage:/lastfm
#!/usr/bin/php
<?
# get api key here: https://www.last.fm/api/account/create
$api_key = "API_KEY_HERE";
$user = "HANDLE_HERE"; # case sensitive
$method = "method=user.getrecenttracks&user=";
$path = "http://ws.audioscrobbler.com/2.0/?";
$key = "&api_key=".$api_key;
@ViralTaco
ViralTaco / designer.html
Last active March 30, 2016 22:42
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;