Skip to content

Instantly share code, notes, and snippets.

View macram's full-sized avatar
💭
I may be slow to respond.

Manu Mateos macram

💭
I may be slow to respond.
View GitHub Profile
@macram
macram / most-listened-artist-lastfm.html
Last active September 13, 2025 14:44
Hugo shortcode to show most played artists on Last.FM
{{ if .Get "period" }}
{{ if .Get "user" }}
{{ $apikey := "" }}
{{ $username := .Get "user" }}
{{ $baseUrl := "https://ws.audioscrobbler.com/2.0/?method=user.gettopartists&format=json" }}
{{ $period := .Get "period" }}
{{ $limit := .Get "limit" | default "5" }}
{{ $url := printf "%s%s%s%s%s%s%s%s%s" $baseUrl "&user=" $username "&api_key=" $apikey "&period=" $period "&limit=" $limit }}
{{ with resources.GetRemote $url | transform.Unmarshal }}
@macram
macram / innerShadow.swift
Last active June 4, 2018 11:26 — forked from r-plus/innerShadow.swift
inner shadow extension and playground. This is forked from another but updated to a more recent Swift version
import UIKit
import PlaygroundSupport
extension UIView {
public func addInnerShadow(topColor: UIColor = UIColor.black.withAlphaComponent(0.3)) {
let shadowLayer = CAGradientLayer()
shadowLayer.cornerRadius = layer.cornerRadius
shadowLayer.frame = bounds
shadowLayer.frame.size.height = 10.0
shadowLayer.colors = [