Requires grunt-spritesmith which generates a spritesheet from a bunch of images.
This gist passes a custom template for spritesmith to generate the SCSS file.
Gruntfile.js
sprite: {
src: "images/*.png",
<select name="country"> | |
<option value="AF">Afghanistan 🇦🇫</option> | |
<option value="AO">Angola 🇦🇴</option> | |
<option value="AL">Albania 🇦🇱</option> | |
<option value="AD">Andorra 🇦🇩</option> | |
<option value="AE">United Arab Emirates 🇦🇪</option> | |
<option value="AR">Argentina 🇦🇷</option> | |
<option value="AM">Armenia 🇦🇲</option> | |
<option value="AG">Antigua and Barbuda 🇦🇬</option> | |
<option value="AU">Australia 🇦🇺</option> |
Requires grunt-spritesmith which generates a spritesheet from a bunch of images.
This gist passes a custom template for spritesmith to generate the SCSS file.
Gruntfile.js
sprite: {
src: "images/*.png",
At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.
git commit --amend
This will open your $EDITOR
and let you change the message. Continue with your usual git push origin master
.
'use strict'; | |
// Требует node.js и пакета mkdirp | |
// Пакет mkdirp: https://www.npmjs.com/package/mkdirp#install — установить глобально или прописать установку в package.json, в секции devDependencies | |
// Использование: | |
// - поместить этот файл в корень проекта | |
// - исправить пути к генерируемым папкам и файлам, если блоки проекта лежат не в ./src/blocks/ | |
// - в терминале, будучи в корневой папке проекта, выполнить node createBlock.js [имя блока] [доп. расширения через пробел] | |
const fs = require('fs'); // будем работать с файловой системой |
// Add on element with overflow | |
-webkit-mask-image: -webkit-radial-gradient(white, black); |
var defaultTitle = document.title; | |
// subscribe to visibility change events | |
document.addEventListener('visibilitychange', function () { | |
// fires when user switches tabs, apps, goes to homescreen, etc. | |
if (document.visibilityState === 'hidden') { | |
document.title = 'Baby, Come Back!' | |
} | |
// fires when app transitions from prerender, user returns to the app / tab. | |
if (document.visibilityState === 'visible') { |
Branch A has commits (X,Y) that also need to be in Branch B. The cherry-pick operations should be done in the same chronological order that the commits appear in Branch A.
cherry-pick
does support a range of commits, but if you have merge commits in that range, it gets really complicated
git checkout branch-B
git cherry-pick X
git cherry-pick Y
var penthouse = require('penthouse'); | |
var fs = require('fs'); | |
var cleanCSS = require('clean-css'); | |
gulp.task('penthouse', ['styles'], function () { | |
penthouse({ | |
url: ['http://chadwicks.dev'], | |
css: 'assets/css/application.css', | |
width: 480, | |
height: 800 |
Visit the new improved script here! Smooth scroll to top of page (Improved!)
If you need a plain JavaScript function to add a smooth scrolling back to the top of the page, you can use this script.
<body>
tag. Like this: <body id="top">
onclick
function to the link. Like this: <a href="#top" onclick="scrollToTop(); return false">Back to Top ↑</a>
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |