Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Directing projects

Vincent V. Toscano VincentVToscano

💭
Directing projects
View GitHub Profile
@hoyangtsai
hoyangtsai / iPhoneX.css
Created Nov 27, 2018
IPhone X, Xs Max and XR media query
View iPhoneX.css
/* iPhone X and Xs Max */
@media only screen
and (min-device-width: 375px)
and (min-device-height: 812px)
and (-webkit-device-pixel-ratio: 3)
and (orientation: portrait) {
/* styles */
}
/* iPhone XR */
@wklsh
wklsh / CalMouseDist.js
Last active May 9, 2020
Calculate Distance Between Mouse and center of Element
View CalMouseDist.js
/**
* Calculate disance between mouse and center of element
* @param {obj} element target element
* @param {num} mouseX mouse pos X value
* @param {num} mouseY mouse pos Y value
*/
export function calcDistance(element, mouseX, mouseY) {
const elDimensions = element.getBoundingClientRect();
return Math.floor(
@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active Nov 25, 2021
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
View webstoemp-gulpfile.js
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@OleksiyRudenko
OleksiyRudenko / Build-and-Publish.md
Last active Nov 30, 2021
Building and publishing a web app @ github pages using ParcelJS
View Build-and-Publish.md
@lostfictions
lostfictions / svg-to-css-clip-path-polygon.js
Created Jan 2, 2018
convert an svg to a css clip-path polygon
View svg-to-css-clip-path-polygon.js
// why do this? clip-path accepts a `url` reference to an svg element, right?
// the difference is that anything defined as a `basic-shape` can be animated:
// https://developer.mozilla.org/en-US/docs/Web/CSS/clip-path
const input = `121.151,20.761 170.165,55.885 200.872,3.816 231.145,55.884 280.592,20.762 286.854,80.687 346.526,68.666
327.657,126.005 387.276,139.247 346.502,184 395.796,220.302 340.127,244.647 370.611,297.814 309.636,297.457 316.076,358.381
260.303,333.3 241.622,391.529 200.655,345.979 160.121,391.53 141.008,333.302 85.666,358.381 91.673,297.456 31.131,297.813
61.183,244.647 5.947,220.302 54.81,184 14.466,139.248 73.652,126.004 55.216,68.667 114.457,80.688 `
const viewBoxScale = 4
@Piasy
Piasy / install_ffmpeg.sh
Last active Nov 19, 2021
brew install ffmpeg with all options
View install_ffmpeg.sh
brew options ffmpeg
brew install ffmpeg \
--with-chromaprint \
--with-fdk-aac \
--with-fontconfig \
--with-freetype \
--with-frei0r \
--with-game-music-emu \
--with-libass \
@derekmorash
derekmorash / gulpfile.js
Last active Aug 10, 2021
Gulp task to compile Shopify Liquid tags in SASS with Autoprefixer
View gulpfile.js
var gulp = require('gulp');
var sass = require('gulp-sass');
var replace = require('gulp-replace');
var autoprefixer = require('gulp-autoprefixer');
var concat = require('gulp-concat');
gulp.task('compilesass', function() {
// root SASS file (contains all your includes)
return gulp.src('./sass/style.scss')
// compile SASS to CSS
@nternetinspired
nternetinspired / output-articles-by-collection.liquid
Last active Apr 25, 2021
Loop through Jekyll collections and output their content as sections and articles
View output-articles-by-collection.liquid
{% comment %}
Loops though every collection you defined in _config.yml and grabs the pages they contain; outputting title and full text with good basic html semantics.
Use page.excerpt instead of page.content to grab the first paragraph, blog list style. Markdownify is optional, depends how you authored content in your collections; I typically use Markdown.
{% endcomment % }
{% for collection in site.collections %}
{% assign name = collection.label %}
<section>
@tomysmile
tomysmile / setup-vagrant-macosx.md
Created Apr 26, 2016
How to Install Virtualbox and Vagrant on MacOSX
View setup-vagrant-macosx.md

Install Virtualbox && Vagrant for MacOSX

Vagrant uses Virtualbox to manage the virtual dependencies. You can directly download virtualbox and install or use homebrew for it.

$ brew cask install virtualbox

Now install Vagrant either from the website or use homebrew for installing it.

@skoji
skoji / remove-slack-settings.sh
Created Nov 2, 2015
remove Slack settings (OS X)
View remove-slack-settings.sh
rm -rf ~/Library/Application\ Support/Slack/
rm -rf ~/Library/Containers/com.tinyspeck.slackmacgap/
rm -rf ~/Library/Preferences/com.tinyspeck.slackmacgap.plist
rm -rf ~/Library/Saved\ Application\ State/com.tinyspeck.slackmacgap.savedState
rm ~/Library/Safari/LocalStorage/*slack*