Skip to content

Instantly share code, notes, and snippets.

View vio's full-sized avatar
💭
📦 🔨 🔧

Viorel Cojocaru vio

💭
📦 🔨 🔧
View GitHub Profile
@vio
vio / stylus-nested-block-mixins-bug.md
Last active August 29, 2015 14:20
Stylus - nested block mixins bug
breakpoint()
  @media (min-width: 1024px)
    {block}

retina()
  @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi), (min-resolution: 2dppx)
    {block}

+breakpoint()

BEM - modifiers & children

1. Block, children, modifier (current)

// Default stuyles
.m-toolbar
  &__title
 // styles
@css {
/* mobile only */
@media (max-width: 500px) {}
/* retina */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi), (min-resolution: 2dppx) {}
/* smalltablet */

Current

.element
  font-size: 1em

  +tablet()
    font-size: 1.2em

    +retina()
 font-size: 1.21em
@vio
vio / google-webfonts.md
Last active August 29, 2015 14:13
Google WebFonts response based on UA

Default

curl http://fonts.googleapis.com/css\?family\=Open+Sans

@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v10/cJZKeOuBrn4kERxqtaUH3aCWcynf_cDxXwCLxiixG1c.ttf) format('truetype');
@vio
vio / post-merge
Last active August 29, 2015 14:12 — forked from sindresorhus/post-merge
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
// https://github.com/ariya/phantomjs/issues/10522
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
if (!Function.prototype.bind) {
Function.prototype.bind = function(oThis) {
if (typeof this !== "function") {
// closest thing possible to the ECMAScript 5
// internal IsCallable function
throw new TypeError(
"Function.prototype.bind what is trying to be bound is not callable");

gst git status

gd git diff

gdc git diff --cached

gl

@vio
vio / show-nav.html
Last active December 24, 2015 07:08
<nav role="navigation">
<div id="show-nav" class="show-nav">
<button class="toggle-shownav" name="Toggle menu">
<span></span>
<span></span>
<span></span>
</button>
<ul>
<li class="item item-home item-selectable">
<a href="http://www.thexfactorusa.com/" target=&quot;_blank&quot;>Home</a>
xf-fan-feeds-development-local
xfactor-poll
txt-social-scene
txf-social-hub