Skip to content

Instantly share code, notes, and snippets.

View zerostyle's full-sized avatar
🌋
🌊

Joshua Stearns zerostyle

🌋
🌊
View GitHub Profile
@una
una / style.css
Last active September 22, 2023 18:11
min() max() clamp()
.sidebar {
/* Select smaller of the 2 calculated values
Narrower screens: 20vw, Wider screens: 300px */
width: min(20vw, 300px);
}
.make-the-logo-bigger {
/* Select larger of the 2 calculated values
Basically clamps the font size to 60px or larger (10vw) */
font-size: max(60px, 10vw);
@argyleink
argyleink / easings.css
Created February 26, 2018 22:34
Handy CSS properties for easing functions
:root {
--ease-in-quad: cubic-bezier(0.55, 0.085, 0.68, 0.53);
--ease-in-cubic: cubic-bezier(0.55, 0.055, 0.675, 0.19);
--ease-in-quart: cubic-bezier(0.895, 0.03, 0.685, 0.22);
--ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06);
--ease-in-expo: cubic-bezier(0.95, 0.05, 0.795, 0.035);
--ease-in-circ: cubic-bezier(0.6, 0.04, 0.98, 0.335);
--ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
--ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
--ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1);
stage all changedd files for a commit

git add .

stage specific file for a commit

git add /path/to/file

for some reason you want to unstage

git reset unstage all files
git reset /path/to/file unstage specific file

@dcollien
dcollien / ImageTools.es6
Last active April 28, 2023 09:00
Resize Images in the Browser
let hasBlobConstructor = typeof(Blob) !== 'undefined' && (function () {
try {
return Boolean(new Blob());
} catch (e) {
return false;
}
}());
let hasArrayBufferViewSupport = hasBlobConstructor && typeof(Uint8Array) !== 'undefined' && (function () {
try {
@lelandrichardson
lelandrichardson / InfiniteScroll.js
Created July 9, 2015 01:02
Super Light Infinite Scroll Component in React
var React = require('react');
var { Component, PropTypes } = React;
var throttle = require('lodash/function/throttle');
class InfiniteScroll extends React.Component {
static propTypes = {
hasMore: PropTypes.bool.isRequired,
isLoading: PropTypes.bool.isRequired,
onLoadMore: PropTypes.func.isRequired,
threshold: PropTypes.number,
@fregante
fregante / git-get-git-put.md
Created June 30, 2015 18:34
Use git get and put instead of git pull and push

As explained on Don't Be Scared of git rebase, git fetch+rebase is a better alternative to git pull; unfortunately it's not as concise.

git get

From now on, use git get instead of git pull, a custom command that does this:

# get data from remote
git fetch origin
# rebase the remote branch with the same name as local
@mlouro
mlouro / gulpfile.js
Last active June 21, 2022 23:20
gulpfile.js with browserify, jshint, libsass, browserSync for livereload, image optimization and system notifications on errors
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var uglify = require('gulp-uglify');
var gulpif = require('gulp-if');
var exec = require('child_process').exec;
var notify = require('gulp-notify');
@JamesMGreene
JamesMGreene / clipboard.js
Last active November 5, 2019 07:47
HTML Clipboard API clarification example
var btn = document.getElementById("copy-button");
btn.addEventListener("click", clickHandler, false);
btn.addEventListener("copy", copyHandler, false);
function clickHandler(e) {
e.target.dispatchEvent(new ClipboardEvent("copy"));
}
function copyHandler(e) {
e.clipboardData.setData("text/plain", "Simulated copy. Yay!");
@jednano
jednano / gitcom.md
Last active May 31, 2023 08:23
Common git commands in a day-to-day workflow

Git Cheat Sheet

Initial Setup

Create an empty git repo or reinitialize an existing one

git init
@olivierlacan
olivierlacan / An_example.markdown
Created February 18, 2012 05:40 — forked from renz45/An_example.markdown
Re-style Sublime Text 2 sidebar to a darker theme

This re-styles your sublime text 2 sidebar to be darker, so it doesn't blind you when using a dark theme.

Dark sublime text 2 sidebar

Save the Default.sublime-theme file into packages/Theme - Default, make a backup of your original if you want to be able to go back easily.