Skip to content

Instantly share code, notes, and snippets.

View samumist's full-sized avatar
🎯
Focusing

Zheng Xu samumist

🎯
Focusing
View GitHub Profile
@samumist
samumist / css-guards.less
Last active July 18, 2017 08:56
css guards with LESS and @if directive with Sass
@debug: false;
article {
color: @message-color;
border: none;
& when (@debug) {
border: 5px solid yellow;
}
}
.multiple-background-blend-mode {
width: 100%;
max-width: 60rem;
min-height: 400px;
margin: 0 auto;
background:
url('https://unsplash.it/1280/400'),
linear-gradient(135deg, red 0%, green 100%),
linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(233, 234, 90, 0.9) 100%),
url('images/pattern.png');
@samumist
samumist / transitioning-gradients.css
Last active July 18, 2017 03:30
gradient background transition hack
.gradient {
position: relative;
background-image: linear-gradient(to right, hsl(211, 100%, 50%), hsl(179, 100%, 30%));
z-index: 1;
}
.gradient:before {
position: absolute;
content: "";
top: 0;
@samumist
samumist / minireset.css
Last active July 18, 2017 03:30
A tiny modern CSS reset with border-box sizing with clearfix
/*! minireset.css v0.0.3 | MIT License | github.com/jgthms/minireset.css */
html,
body,
p,
ol,
ul,
li,
dl,
dt,
@samumist
samumist / active_nav.coffee
Created April 13, 2017 06:45
Highlight the active nav link with jQuery in Twitter Bootstrap.
$ ->
# Highlight the active nav link.
url = window.location.pathname
filename = url.substr(url.lastIndexOf('/') + 1)
$('.navbar a[href$="' + filename + '"]').parent().addClass 'active'
@samumist
samumist / box-sizing.css
Last active July 18, 2017 03:30
CSS code snippets - multiple css background images with background-blend-mode
/* border box fix */
html {
box-sizing: border-box;
}
*,
*:before,
*:after {
box-sizing: inherit;
@samumist
samumist / vim74_lua
Last active July 18, 2017 03:21 — forked from jdewit/vim74_lua
Installing vim 7.4 with lua on Ubuntu 12.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get build-dep vim-gnome
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo rm -rf /usr/local/share/vim
sudo rm /usr/bin/vim