Skip to content

Instantly share code, notes, and snippets.

View jonchretien's full-sized avatar
📷

Jon C. jonchretien

📷
View GitHub Profile
@jonchretien
jonchretien / shell.md
Last active August 10, 2020 21:17
Xcode/Node errors

fix TypeError: fsevents is not a function

rm -rf node_modules
rm -f yarn.lock
yarn
npm cache verify
@jonchretien
jonchretien / my-top-albums.js
Last active June 9, 2019 14:42
Retrieve a unique list of my top albums on Spotify
#!/usr/bin/env node
// module dependencies
const fs = require('fs');
const axios = require('axios');
const config = require('../config/local');
/**
* Request my top albums from the Spotify API.
*/
@jonchretien
jonchretien / vscode-settings.js
Last active June 30, 2020 20:06
cmd+shift+p > Preferences: Open Settings (JSON)
// Place your settings in this file to overwrite the default settings
{
// Controls the font family.
"editor.fontFamily": "Operator Mono",
// Controls the font size in pixels.
"editor.fontSize": 24,
"editor.formatOnPaste": false,
"editor.minimap.enabled": false,
"editor.multiCursorModifier": "ctrlCmd",
"editor.snippetSuggestions": "top",
(async () => {
const response = await fetch('https://api.spotify.com/v1/tracks/6JEK0CvvjDjjMUBFoXShNZ');
const { name } = await response.json();
console.log(name);
})();
let swapHeaderImage = (() => {
const hero = document.querySelector('.hero');
let current = 1;
let next = 2;
function init() {
hero.classList.remove(Array.from(hero.classList).pop());
hero.classList.add(`artist-banner-${current}`);
}
@jonchretien
jonchretien / index.html
Created November 5, 2015 16:19
Learning React
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Spotify Artist Search</title>
<link rel="stylesheet" type="text/css" href="https://developer.spotify.com/web-api/static/css/cached.css">
<style>
body {
padding: 20px;
}
<snippet>
<content><![CDATA[
<% $1 %>
]]></content>
<tabTrigger>%</tabTrigger>
<description>ERB Tag</description>
<scope>source.erb</scope>
</snippet>
@jonchretien
jonchretien / notes.md
Last active August 29, 2015 14:18
Notes from OpenVis Conf 2015. Scaffolding generated with https://github.com/jonchretien/conf-notes-template.
@jonchretien
jonchretien / person.ajs
Last active August 29, 2015 14:17 — forked from tj/person.ajs
// Alternative JavaScript Syntax
Person = :(name, address) { @name!, @address! }
Person::inspect = :{ <: "{@name} lives at {@address}" }
tj := Person('TJ', '314 Bessborough ave')
bob := Person('Bob', 'Some place')
[tj, bob].each(:(person){ print(person.inspect()) })