Skip to content

Instantly share code, notes, and snippets.

View BroFox86's full-sized avatar

Daur Gamisonia BroFox86

View GitHub Profile
@good-idea
good-idea / countries.html
Created January 15, 2019 02:11
Country Select options (with Emoji flags)
<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>

Easy responsive sprites with background-size using grunt-spritesmith and SCSS

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",
@nepsilon
nepsilon / git-change-commit-messages.md
Last active June 2, 2024 23:31
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

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 🙂.

Not pushed + most recent commit:

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'); // будем работать с файловой системой
@ayamflow
ayamflow / gist:b602ab436ac9f05660d9c15190f4fd7b
Created May 9, 2016 19:10
Safari border-radius + overflow: hidden + CSS transform fix
// 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') {
@unbracketed
unbracketed / branch-fu.md
Created April 7, 2015 17:49
Moving commits between branches

Example: Moving up to a few commits to another branch

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
@tjFogarty
tjFogarty / penthouse-gulp.js
Created September 19, 2014 11:54
Penthouse - gulp
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
@ricardozea
ricardozea / Smooth scroll to top of page.markdown
Last active May 12, 2024 12:12
Smooth scroll to top of page

Visit the new improved script here! Smooth scroll to top of page (Improved!)


Smooth scroll to top of page (Legacy!)

If you need a plain JavaScript function to add a smooth scrolling back to the top of the page, you can use this script.

  1. Add an id of "top" to the <body> tag. Like this: <body id="top">
  2. Add the onclick function to the link. Like this: <a href="#top" onclick="scrollToTop(); return false">Back to Top ↑</a>
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #