Skip to content

Instantly share code, notes, and snippets.

View axelav's full-sized avatar
🕸️

Axel Anderson axelav

🕸️
View GitHub Profile
@axelav
axelav / 55-bytes-of-css.md
Created September 27, 2022 09:43 — forked from JoeyBurzynski/55-bytes-of-css.md
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
// https://www.strava.com/athlete/training
// json -> csv https://konklone.io/json/
const MAX_PAGE = 50; // calculate this using (activities/20 + 1)
const ACTIVITY_TYPE = "Workout"; // change to the workout type you want, or blank for all
/* const url = "https://www.strava.com/athlete/training_activities" + */
/* "?keywords=&activity_type=" + ACTIVITY_TYPE + "&workout_type=&commute=&private_activities=" + */
/* "&trainer=&gear=&new_activity_only=false" + */
/* "&page=" + p + "&per_page=20"; */
@axelav
axelav / gist:1839777
Created February 15, 2012 22:51 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@axelav
axelav / api.js
Created January 8, 2020 00:55
`useFetch` example
// https://github.com/zeit/next.js/blob/8e2097997e75d8867a9111c861b624e35e14f811/examples/with-graphql-faunadb/graphql/api.js
import useFetch from '../lib/useFetch'
function getData(data) {
if (!data || data.errors) return null
return data.data
}
function getErrorMessage(error, data) {

HEADLESS RASPBERRY PI SETUP WITH OS X

Creating a disk image:

http://txfx.net/2012/12/05/raspberry-pi-headless-setup/

$ sudo diskutil unmount /dev/disk1s1
$ sudo dd bs=1M if=/Users/axelav/Downloads/rpi.img of=/dev/rdisk1 # NOTE: `disk1s1` becomes `rdisk1` DONT FUCK THIS UP
$ sudo diskutil eject /dev/rdisk1
scheme: "Gruvbox dark, pale"
author: "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)"
base00: "262626" # ----
base01: "3a3a3a" # ---
base02: "4e4e4e" # --
base03: "8a8a8a" # -
base04: "949494" # +
base05: "dab997" # ++
base06: "d5c4a1" # +++
base07: "ebdbb2" # ++++
#!/bin/sh
usage () {
printf "Usage: build <argument>\n"
}
INDEX="./src/index.js"
JS_BUNDLE="bundle.js"
CSS_BUNDLE="bundle.css"
INDEX_HTML="index.html"
@axelav
axelav / parsley.config.js
Last active April 9, 2018 19:14
I had a hard time finding documentation on configuring parsley.js. Here's what I've found you can configure.
// Parsley default config
$.fn.parsley.defaults = {
inputs: 'input, textarea, select',
excluded: 'input[type=hidden], :disabled',
trigger: 'change',
animate: true,
animateDuration: 300,
focus: 'first',
validationMinlength: 3,
04e4a0b6208d78906c346120364a823cc4fc44c41369a85c19f2168f621047b33c270eef60f4ad1602d5cf1cd636ba37d95f97cdafa3c4f1808aa787c4c192b577
@axelav
axelav / localStorage-polyfill.js
Last active January 23, 2018 00:14 — forked from juliocesar/best-localStorage-polyfill-evar.js
This is the best localStorage polyfill in the world
if (!('localStorage' in window)) {
window.localStorage = {
_data : {},
setItem : function(id, val) { return this._data[id] = String(val); },
getItem : function(id) { return this._data.hasOwnProperty(id) ? this._data[id] : undefined; },
removeItem : function(id) { return delete this._data[id]; },
clear : function() { return this._data = {}; }
};
}