Skip to content

Instantly share code, notes, and snippets.

View 7studio's full-sized avatar

Xavier Zalawa 7studio

View GitHub Profile
@bpierre
bpierre / hash.js
Created February 23, 2014 17:56
Mini location.hash system + mini routing system (useful with PhoneGap)
/*
* Mini location.hash update system
*
* Usage:
*
* var createHash = require('./hash');
* var hash = createHash('!/', function(value) {
* // Value updated
* });
*
var isArray = function (obj) {
return Object.prototype.toString.call(obj) === '[object Array]';
};

Devices

iPhone
GT-I9300
SAMSUNG GT-I9505
HTC One
Lumia 520
iPad
GT-I9100
GT-I9505
Lumia 920

.initial
.top-banner-ad-container
.top-banner-ad-container--desktop
.top-banner-ad-container--facia-layout
.ad-slot
module Sass::Script::Functions
def file_exists(path)
return bool(false) unless options[:filename] # not all sass has a file name (e.g. std input)
current_directory = File.dirname(options[:filename]) rescue nil # a sass filename from an importer may not be processable by File.dirname
return bool(false) unless current_directory && File.exist?(current_directory) # not all sass files are served from the filesystem
full_path = File.expand_path(path.value, current_directory) # a relative path will be expanded against the current_directory of the sass file, symlinks will be followed, absolute paths will be left alone.
return bool(File.exist?(full_path))
end
end
@thom4parisot
thom4parisot / README.md
Last active August 29, 2015 14:06
Node.js usual project directory structure.
├── bin
├── config
├── data
├── dist
├── doc
├── lib
│   └── models
├── node_modules
├── src

Twitter's handling of emojis

I just saw this in a tweet:

<img class="twitter-emoji" src="https://abs.twimg.com/emoji/v1/72x72/1f61a.png" draggable="false" alt="😚" title="Kissing face with closed eyes" aria-label="Emoji: Kissing face with closed eyes">

I couldn't help thinking:

  1. Yay, Twitter gives a lot of consideration to Accessibility and this is good.
  2. Hey, this alt means nothing to the people who may need it

About Sass and Gzip

I am a little familiar with the idea behind Gzip, thanks to this great video from Frédéric Kayser (in French), however there is a something I am still not sure about.

Basically, a string gets more and more compressed every time it is being repeated. And unless I'm wrong, the longer the string, the better.

Let's talk about Sass for a second. Please consider this mixin:

@mixin center($max-width) {
@mathiasbynens
mathiasbynens / some-more-info-on-css-hacks.md
Created May 25, 2011 17:33
Some more info on CSS hacks

There seems to be a difference between longhand properties (e.g. background-color) and shorthand properties (e.g. background). Some CSS hacks only work for one or the other. I’ve updated my test case to test these separately, and there are some interesting results.

The following hacks target IE8 but not IE9:

  • longhandproperty: \0value\0;
  • longhandproperty: \0value;

In practice, you might use these like so:

  • background-color: \0red\0;
project.scss
    components/
        global/
            page-head.scss
            pricing-table.scss
            image-gallery.scss
        home/
            quick-search.scss
    inuit.css/

pages/