Skip to content

Instantly share code, notes, and snippets.

View leemartin's full-sized avatar

Lee Martin leemartin

View GitHub Profile
@leemartin
leemartin / create-apple-music-playlist.js
Created December 8, 2018 20:26
Create Apple Music Playlist
// initialize axios instance
let apple = axios.create({
baseURL: 'https://api.music.apple.com/v1',
headers: {
'Authorization': `Bearer ${developerToken}`,
'Music-User-Token': `${musicUserToken}`
}
})
// create playlist
@leemartin
leemartin / create-spotify-playlist-with-artwork.js
Last active December 8, 2018 20:24
Create Spotify Playlist with Artwork
// initialize axios instance
let spotify = axios.create({
baseURL: 'https://api.spotify.com',
headers: {
'Authorization': `Bearer ${token}`
}
})
// get user id for playlist creation
spotify.get('/v1/me').then(res => {
@leemartin
leemartin / Palette.vue
Created September 20, 2018 00:31
Turn Palette Color Picker
<template>
<ul>
<li v-for="color in colors" :style="{ background: `rgb(${color[0]},${color[1]},${color[2]})`}" @click="selectColor(color)"></li>
</ul>
</template>
<script>
export default{
props: ['colors'],
methods: {
@leemartin
leemartin / instagram-dl.js
Created September 11, 2018 22:51
Download Instagram Videos
// node instagram-dl.js BnmcJ-tnAey
const rest = require('restler')
const fs = require('fs')
const request = require('request')
rest.get(`https://www.instagram.com/p/${process.argv.slice(2)[0]}/?__a=1`).on('complete', function(data) {
var videoUrl = data.graphql.shortcode_media.video_url
var videoFilename = videoUrl.split("/")[videoUrl.split("/").length - 1]
@leemartin
leemartin / listen.js
Created September 7, 2018 21:44
Figma x Turn x Codepen
const app = new Vue({
el: '#app',
data() {
return {
figmaToken: '',
baseUrl: 'https://api.figma.com/v1',
fileId: '',
nodeId: '',
images: null,
nodes: null
@leemartin
leemartin / musickit-token-encoder.js
Last active July 28, 2022 01:54
Apple Music API Token for MusicKit
"use strict";
const fs = require("fs");
const jwt = require("jsonwebtoken");
const privateKey = fs.readFileSync("AuthKey.p8").toString();
const teamId = "ABCDE12345";
const keyId = "ABCDE12345";
const jwtToken = jwt.sign({}, privateKey, {
@leemartin
leemartin / artwork
Last active August 29, 2015 14:03
Artwork FM YouTube Embed
<iframe frameborder='0' height='320' src='http://www.youtube.com/embed/VIDEO_ID?autoplay=1&rel=0&autohide=1&controls=1&fs=0&modestbranding=1&showinfo=0&hd=1&vq=hd1080&color=white' width='320'></iframe>
@leemartin
leemartin / logo.sass
Created February 5, 2013 21:40
My new personal logo can be created completely with CSS borders.
$white: #FFFFFF
$grey: #CCC
$logo: 75px
#logo
height: $logo
width: $logo * 2
&:before, &:after
border-style: solid
@leemartin
leemartin / sprites.coffee
Created January 25, 2013 17:33
WebRTC Sprites Generator
$ ->
# Variables
photo = 0
size = 150
directions =
center: { x: size, y: size, i: "straight ahead" }
north: { x: size, y: 0, i: "up" }
northwest: { x: 0, y: 0, i: "up over your right shoulder" }
west: { x: 0, y: size, i: "right" }
southwest: { x: 0, y: size * 2, i: "at your right shoulder" }
@leemartin
leemartin / slots.coffee
Last active June 23, 2020 13:05
CSS3 Slot Machine
$ ->
result = []
count = 0
# Loop through each reel
$('.reel-outer'). each ->
$this = $(this)
index = $this.index()
spinPlus = 0