Skip to content

Instantly share code, notes, and snippets.

View jmegs's full-sized avatar

John Meguerian jmegs

View GitHub Profile
@jmegs
jmegs / plates.js
Last active May 12, 2016 20:31
calculate the number and kind of plates on each side of a barbell
var plates = [45, 25, 10, 5, 2.5];
var target_weight = prompt("Enter Target Weight");
var remaining = (target_weight - 45) / 2
var result = [];
for (var i = 0; i < plates.length; i++) {
var plate = plates[i];
if (remaining < plate) {
continue;
} else {
@jmegs
jmegs / getcontent.js
Created May 26, 2018 12:41
Node script to fetch content from Contentful API
const fs = require("fs")
const path = require("path")
require("dotenv").config()
const SPACE = process.env.CONTENTFUL_SPACE
const TOKEN = process.env.CONTENTFUL_TOKEN
const client = require("contentful").createClient({
space: SPACE,
accessToken: TOKEN
@jmegs
jmegs / micro-reset.css
Created June 7, 2018 13:05
Micro CSS Reset
html {
box-sizing: border-box;
font-family: system-ui;
}
*,
*:before,
*:after {
box-sizing: inherit;
margin: 0;
padding: 0;
@jmegs
jmegs / boxstarter.ps1
Created November 7, 2018 05:37 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@jmegs
jmegs / Windows10-Setup.ps1
Created November 7, 2018 05:43 — forked from NickCraver/Windows10-Setup.ps1
(In Progress) PowerShell Script I use to customize my machines in the same way for privacy, search, UI, etc.
##################
# Privacy Settings
##################
# Privacy: Let apps use my advertising ID: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0
# To Restore:
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1
# Privacy: SmartScreen Filter for Store Apps: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0
@jmegs
jmegs / easing.css
Created November 27, 2018 22:45 — forked from bendc/easing.css
Easing CSS variables
:root {
--ease-in-quad: cubic-bezier(.55, .085, .68, .53);
--ease-in-cubic: cubic-bezier(.550, .055, .675, .19);
--ease-in-quart: cubic-bezier(.895, .03, .685, .22);
--ease-in-quint: cubic-bezier(.755, .05, .855, .06);
--ease-in-expo: cubic-bezier(.95, .05, .795, .035);
--ease-in-circ: cubic-bezier(.6, .04, .98, .335);
--ease-out-quad: cubic-bezier(.25, .46, .45, .94);
--ease-out-cubic: cubic-bezier(.215, .61, .355, 1);
@jmegs
jmegs / localStorage.js
Created January 9, 2019 15:31
local storage helper functions
export const getItemFromStorage = key => {
if (!localStorage) return
try {
return JSON.parse(localStorage.getItem(key))
} catch (err) {
return null
}
}
@jmegs
jmegs / _base.css
Last active February 5, 2019 21:20
CSS Base
/* CSS Base File
Forked from @ireade */
/* Reset margin, padding, border */
/* prettier-ignore */
html, body,
h1, h2, h3, h4, h5, h6,
a, p, span,
em, small, strong,
[
{
"name": "easeInSine",
"css": "cubic-bezier(0.47, 0, 0.745, 0.715)"
},
{
"name": "easeOutSine",
"css": "cubic-bezier(0.39, 0.575, 0.565, 1)"
},
{
# Specify the preferences directory
defaults write com.googlecode.iterm2.plist PrefsCustomFolder -string "~/Dropbox/etc/iterm"
# Tell iTerm2 to use the custom preferences in the directory
defaults write com.googlecode.iterm2.plist LoadPrefsFromCustomFolder -bool true